From ef08a423846c0fe8599c6444a7649da38b569602 Mon Sep 17 00:00:00 2001 From: staffadmin Date: Sat, 18 Nov 2023 19:26:40 +0100 Subject: [PATCH] POUSh --- .gitea/workflows/build_image.yaml | 52 +++++++++++++++++-------------- .gitea/workflows/demo.yaml | 2 ++ Dockerfile | 1 - 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/.gitea/workflows/build_image.yaml b/.gitea/workflows/build_image.yaml index 675a47e..810db9e 100644 --- a/.gitea/workflows/build_image.yaml +++ b/.gitea/workflows/build_image.yaml @@ -14,14 +14,17 @@ jobs: steps: - # - name: Print to Log - # id: print-to-log - # env: - # REGISTRY: registry.jingoh.fr - # uses: https://github.com/actions/hello-world-docker-action@main - # with: - # who-to-greet: ${{ env.REGISTRY }} - + # TEST + - name: Print vars test + run: echo ${{ var.REGISTRY_DOCKER }} ${{ vars.REGISTRY_DOCKER }} + - name: Print Gitea runner tag + run: echo {{ env.GITEA_RUNNER_TAG }} + - name: Get all Gitea runner variables + uses: actions/get-variables-action@v1 + with: + env: true + - name: Print all Gitea runner variables + run: echo {{ toJson(steps.get-variables-action.outputs.allVariables) }} - name: Checkout private tools uses: https://github.com/actions/checkout@v3 with: @@ -29,10 +32,10 @@ jobs: repository: staffadmin/gitea-runner persist-credentials: false ssh-strict: false - token: ${{ secrets.ACCESS_TOKEN_GIT }} # `GH_PAT` is a secret that contains your PAT + token: ${{ secrets.ACCESS_TOKEN_GIT }} ssh-known-hosts: ${{ secrets.SSH_KNOWN_GITEA }} - # Install DOCKER + # INSTALL docker - run: apt-get update - run: apt-get install ca-certificates curl gnupg - run: install -m 0755 -d /etc/apt/keyrings @@ -42,25 +45,28 @@ jobs: - run: apt-get update - run: apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + # BUILD & PUSH docker image - name: Build the Docker image run: docker build . --file Dockerfile --tag test:$(date +%s) + # - name: Login to registry + # run: docker login -u "test:test" https://registry.jingoh.fr - # # Install the cosign tool except on PR - # # https://github.com/sigstore/cosign-installer - - name: Install cosign - #if: gitea.event_name != 'pull_request' - uses: https://github.com/sigstore/cosign-installer@v2.6.0 #v2.6.0 - with: - cosign-release: 'v1.11.0' - - # Workaround: https://github.com/docker/build-push-action/issues/461 - - name: Setup Docker buildx - uses: https://github.com/docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 - + # # # Install the cosign tool except on PR + # # # https://github.com/sigstore/cosign-installer + # - name: Install cosign + # #if: gitea.event_name != 'pull_request' + # uses: https://github.com/sigstore/cosign-installer@v2.6.0 #v2.6.0 + # with: + # cosign-release: 'v1.11.0' + # # Workaround: https://github.com/docker/build-push-action/issues/461 + # - name: Setup Docker buildx + # uses: https://github.com/docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 # Login against a Docker registry except on PR # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY_DOCKER }} - #if: gitea.event_name != 'pull_request' + env: + REGISTRY_DOCKER: registry.jingoh.fr uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 with: registry: ${{ env.REGISTRY_DOCKER }} diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 92ac613..d8d4d8e 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -2,6 +2,8 @@ name: Gitea Actions Demo run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 on: [never] +## Exemple https://github.com/actions/starter-workflows/blob/main/ci/docker-publish.yml + jobs: Explore-Gitea-Actions: runs-on: ubuntu-latest diff --git a/Dockerfile b/Dockerfile index 89d66b5..1e24c83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,3 @@ -# Exemple https://github.com/actions/starter-workflows/blob/main/ci/docker-publish.yml # Container image that runs your code FROM alpine:3.10