checkout first

This commit is contained in:
Simon Ungar Felding 2025-02-17 18:25:23 +01:00
parent bf5a56d968
commit fa91962c3e
2 changed files with 14 additions and 8 deletions

View File

@ -23,6 +23,9 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@master
- name: Prepare
run: |
platform=${{ matrix.platform }}
@ -30,7 +33,7 @@ jobs:
- name: Set version
id: version
run: echo "::set-output name=version::`cat VERSION`"
run: echo "version=`cat VERSION`" >> $GITHUB_ENV
- name: Docker meta
id: meta
@ -55,7 +58,7 @@ jobs:
file: ./build/Dockerfile
tags: localbuild/protonmail-bridge:test
build-args: |
version="${{ steps.version.outputs.version }}"
version="${{ env.version }}"
- name: Scan image
id: scan
uses: anchore/scan-action@v6
@ -80,6 +83,9 @@ jobs:
- linux/arm/v7
- linux/riscv64
steps:
- name: Checkout
uses: actions/checkout@master
- name: Prepare
run: |
platform=${{ matrix.platform }}
@ -87,7 +93,7 @@ jobs:
- name: Set version
id: version
run: echo "::set-output name=version::`cat VERSION`"
run: echo "version=`cat VERSION`" >> $GITHUB_ENV
- name: Docker meta
id: meta
@ -125,11 +131,11 @@ jobs:
outputs: type=image,"name=name=${{ env.DOCKERHUB_REPO }},${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,push=true
context: ./build
file: ./build/Dockerfile
tags: build,{{ steps.version.outputs.version }}-build
tags: build,{{ env.version }}-build
provenance: true
sbom: true
build-args: |
version="${{ steps.version.outputs.version }}"
version="${{ env.version }}"
- name: Export digest
run: |
@ -196,7 +202,7 @@ jobs:
${{ env.DOCKERHUB_REPO }}
${{ env.GHCR_REPO }}
tags: |
type=raw,enable=true,value=${{ steps.version.outputs.version }}-build
type=raw,enable=true,value=${{ env.version }}-build
type=raw,enable=true,suffix=,value=build
- name: Create manifest list and push

View File

@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@master
- name: Set version
id: version
run: echo "::set-output name=version::`cat VERSION`"
run: echo "version=`cat VERSION`" >> $GITHUB_ENV
- name: Set repo
id: repo
run: if [[ $GITHUB_REF == "refs/heads/master" ]]; then echo "::set-output name=repo::${DOCKER_REPO}"; else echo "::set-output name=repo::${DOCKER_REPO_DEV}"; fi
@ -74,6 +74,6 @@ jobs:
file: ./deb/Dockerfile
tags: |
${{ steps.repo.outputs.repo }}:latest
${{ steps.repo.outputs.repo }}:${{ steps.version.outputs.version }}
${{ steps.repo.outputs.repo }}:${{ env.version }}
labels: ${{ steps.docker_meta.outputs.labels }}
push: ${{ github.event_name != 'pull_request' }}