-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docker build to release workflow (#186)
* Add docker build to release workflow Signed-off-by: Faisal Memon <[email protected]> * Add package write permissions Signed-off-by: Faisal Memon <[email protected]> --------- Signed-off-by: Faisal Memon <[email protected]>
- Loading branch information
1 parent
089a13d
commit dbfe5a6
Showing
2 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ jobs: | |
build: | ||
name: build (linux) | ||
runs-on: ubuntu-22.04 | ||
needs: integration-tests | ||
|
||
steps: | ||
- name: Checkout | ||
|
@@ -53,22 +54,31 @@ jobs: | |
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'go.mod' | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build artifact | ||
run: make build | ||
- name: Build docker artifact | ||
run: make docker-build | ||
- name: Compress artifact | ||
run: tar -czvf spiffe-helper-${{ github.ref_name }}.tar.gz spiffe-helper | ||
- name: Archive artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: spiffe-helper | ||
path: spiffe-helper-${{ github.ref_name }}.tar.gz | ||
path: | | ||
spiffe-helper-${{ github.ref_name }}.tar.gz | ||
spiffe-helper-image.tar | ||
release: | ||
runs-on: ubuntu-22.04 | ||
needs: build | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout | ||
|
@@ -77,9 +87,19 @@ jobs: | |
uses: actions/download-artifact@v4 | ||
with: | ||
name: spiffe-helper | ||
path: ./artifact/ | ||
path: . | ||
- name: Log in to GHCR | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install regctl | ||
uses: regclient/actions/regctl-installer@main | ||
- name: Push docker image | ||
run: ./.github/workflows/scripts/push-images.sh ${{ github.ref_name }} | ||
- name: Create Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Create the release using the version number as the title | ||
run: gh release create "${GITHUB_REF#refs/tags/}" ./artifact/spiffe-helper-${{ github.ref_name }}.tar.gz --title "${GITHUB_REF#refs/tags/}" | ||
run: gh release create "${GITHUB_REF#refs/tags/}" ./spiffe-helper-${{ github.ref_name }}.tar.gz --title "${GITHUB_REF#refs/tags/}" |