diff --git a/workflow-templates/container.yml b/workflow-templates/container.yml index 858aa65..2678248 100644 --- a/workflow-templates/container.yml +++ b/workflow-templates/container.yml @@ -6,13 +6,24 @@ on: pull_request: branches: [ $default-branch ] +env: + platforms: linux/amd64, linux/arm64 + DOCKERHUB_USER: "${{ fromJSON(secrets.VAULT_KV_1D187965_OP_DOCKERHUB_INFRA_MACHINE).username }}" + DOCKERHUB_TOKEN: "${{ fromJSON(secrets.VAULT_KV_1D187965_OP_DOCKERHUB_INFRA_MACHINE).token }}" + + QUAY_USER: "${{ fromJSON(secrets.VAULT_KV_1D187965_OP_QUAY_ROBOT_ACCOUNT).username }}" + QUAY_TOKEN: "${{ fromJSON(secrets.VAULT_KV_1D187965_OP_QUAY_ROBOT_ACCOUNT).password }}" + + BOT_ACCESS_TOKEN: "${{ fromJSON(secrets.VAULT_KV_1D187965_OP_GITHUB_INFRALOVERS).PAT }}" + + jobs: prebuild: runs-on: ubuntu-latest outputs: version: ${{ steps.semrel.outputs.version }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check pre-commit presence id: precommit_exists @@ -23,7 +34,7 @@ jobs: - uses: actions/setup-python@v3 if: steps.precommit_exists.outputs.files_exists == 'true' - - uses: pre-commit/action@v3.0.0 + - uses: pre-commit/action@v3 if: steps.precommit_exists.outputs.files_exists == 'true' - uses: go-semantic-release/action@v1 @@ -38,7 +49,7 @@ jobs: runs-on: ubuntu-latest needs: [ prebuild ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Prepare tagging id: prep @@ -69,12 +80,12 @@ jobs: - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: - platforms: 'arm64,amd64' + platforms: ${{ env.platforms }} - name: Cache Docker layers uses: actions/cache@v2 @@ -86,36 +97,36 @@ jobs: - name: Login to DockerHub if: needs.prebuild.outputs.version != '' - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + username: ${{ env.DOCKERHUB_USER }} + password: ${{ env.DOCKERHUB_TOKEN }} - name: Login to Quay if: needs.prebuild.outputs.version != '' - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: quay.io - username: ${{ secrets.QUAY_USER }} - password: ${{ secrets.QUAY_TOKEN }} + username: ${{ env.QUAY_USER }} + password: ${{ env.QUAY_TOKEN }} - name: Login to GitHub Container Registry if: needs.prebuild.outputs.version != '' - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} - password: ${{ secrets.BOT_ACCESS_TOKEN }} + password: ${{ env.BOT_ACCESS_TOKEN }} - name: Build and push id: docker_build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: builder: ${{ steps.buildx.outputs.name }} context: . - file: ./Dockerfile push: ${{ github.event_name != 'pull_request' && needs.prebuild.outputs.version != '' }} tags: ${{ steps.prep.outputs.tags }} + platforms: ${{ env.platforms }} release: needs: [ prebuild, build ]