-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f0a3a6
commit 7e8f8bb
Showing
4 changed files
with
100 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,27 +14,51 @@ env: | |
|
||
jobs: | ||
|
||
build_and_publish: | ||
dry_run: | ||
if: ${{ github.event_name == 'pull_request' || ( github.event_name == 'release' && startsWith( github.ref, 'refs/tags/tx') && github.event.release.prerelease ) }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- # Add QEMU to allow building non-native containers as | ||
# part of multi-platform container builds. | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- # Setup buildx so we can do multi-platform container builds. | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: build | ||
run: cd ${{ env.IMAGE_NAME }} && docker buildx build --platform linux/arm64,linux/amd64 . | ||
|
||
release: | ||
if: ${{ github.event_name == 'release' && startsWith( github.ref, 'refs/tags/tx' ) && !github.event.release.prerelease }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: process event | ||
id: process_event | ||
uses: olegtarasov/[email protected] | ||
- # Add QEMU to allow building non-native containers as | ||
# part of multi-platform container builds. | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- # Setup buildx so we can do multi-platform container builds. | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GHCR | ||
uses: docker/login-action@v2 | ||
with: | ||
tagRegex: "(${{ env.IMAGE_VERSION_PREFIX }}).*" | ||
- name: dryrun-build | ||
if: ${{ github.event_name == 'pull_request' || ( github.event_name == 'release' && startsWith( steps.process_event.outputs.tag, env.IMAGE_VERSION_PREFIX ) && github.event.release.prerelease ) }} | ||
run: docker build ./${{ env.IMAGE_NAME }} | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: form image tag | ||
id: image_tag | ||
uses: olegtarasov/[email protected] | ||
|
||
- name: build-and-push | ||
if: ${{ github.event_name == 'release' && startsWith( steps.process_event.outputs.tag, env.IMAGE_VERSION_PREFIX ) && !github.event.release.prerelease }} | ||
uses: macbre/push-to-ghcr@master | ||
with: | ||
context: ./${{ env.IMAGE_NAME }} | ||
dockerfile: ./${{ env.IMAGE_NAME }}/Dockerfile | ||
image_name: ${{ env.ORG_NAMESPACE }}/${{ env.IMAGE_NAME }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
repository: ghcr.io | ||
run: cd ${{ env.IMAGE_NAME }} && docker buildx build --platform linux/arm64,linux/amd64 --push -t ghcr.io/${{ env.ORG_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ steps.image_tag.outputs.tag }} . |
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
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