Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and publish Docker image previews from branches #349

Merged
merged 24 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b594c33
Build Docker images for PR
danielelisi Apr 20, 2023
5fdf2b8
Disable darwin
danielelisi Apr 20, 2023
685c883
Create Docker manifest
danielelisi Apr 20, 2023
c7a31a8
Add dockerhub login
danielelisi Apr 21, 2023
4acdbd3
Build only for amd64 and arm64
danielelisi Apr 26, 2023
2a2c2a7
Change snapshot template name to be more descriptive
danielelisi Apr 27, 2023
8eec675
Push preview images to GHCR
danielelisi Apr 27, 2023
3233fb7
Uncomment code
danielelisi Apr 27, 2023
18ac9d4
Delete unused .goreleaser-branch.yml file
danielelisi Apr 27, 2023
fdd4b5a
Use Docker Manifest for preview images
danielelisi Apr 27, 2023
d6e2a64
Change branch
danielelisi Apr 27, 2023
ade8a7f
Debug docker manifest
danielelisi Apr 27, 2023
d66b951
fix(build.yaml): add missing quotation mark in echo statement
danielelisi Apr 27, 2023
89b0791
fix(build.yaml): add missing quotation mark in echo command
danielelisi Apr 27, 2023
9ab36af
ci(build.yaml): change push branch to main and add docker manifest Gi…
danielelisi Apr 28, 2023
ad4cfdf
feat(build.yaml): add conditional debug output for docker image ls step
danielelisi Apr 28, 2023
962ff1c
build: update build.yaml and goreleaser.yml
danielelisi Apr 28, 2023
35d34b3
ci(build.yaml): update docker-manifest-action to use pull_request.hea…
danielelisi Apr 28, 2023
fb72d17
refactor(build.yaml): remove unnecessary echo step in Test job
danielelisi Apr 28, 2023
a20687e
Debug manifest
danielelisi Apr 28, 2023
80ef08f
chore(.goreleaser.yml): comment out unsupported build targets for sig…
danielelisi Apr 28, 2023
a8d9299
Use Docker manifest
danielelisi Apr 28, 2023
39387df
refactor(build.yaml): remove unused steps and comments, rename step t…
danielelisi Apr 28, 2023
716e65d
chore(.goreleaser.yml): uncomment build configurations for MacOS and …
danielelisi Apr 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 24 additions & 18 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: 1.19
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup Code Climate test-reporter
run: |
curl -L "$CC_BINARY_URL" > ./cc-test-reporter
Expand Down Expand Up @@ -55,19 +55,21 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Go
uses: actions/setup-go@v3
- name: Login to DockerHub
uses: docker/login-action@v2
if: "!startsWith(github.ref, 'refs/tags/v')"
with:
go-version: 1.17
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Write release-env file
uses: DamianReeves/write-file-action@v1.0
if: startsWith(github.ref, 'refs/tags/v')
with:
path: ${{ github.workspace }}/.release-env
contents: |
Expand All @@ -76,19 +78,23 @@ jobs:
DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD=${{ secrets.DOCKER_PASSWORD }}

# - name: Write docker-creds file
# uses: DamianReeves/write-file-action@v1.0
# with:
# path: ${{ github.workspace }}/.docker-creds
# contents: |
# ${{ secrets.DOCKERHUB_USERNAME }}:${{ secrets.DOCKER_PASSWORD }}:docker.io
- name: goreleaser release-dry-run
run: make release-dry-run
- name: goreleaser release preview
run: make release-preview
if: "!startsWith(github.ref, 'refs/tags/v')"

- name: goreleaser release main branch
run: make release-main-branch
if: github.ref == 'refs/heads/main'
- name: Tag Docker images appropriately
run: >
docker tag ghcr.io/ecadlabs/signatory:${{ github.sha }}-amd64 ghcr.io/ecadlabs/signatory:${{ github.head_ref || github.ref_name }}-amd64;
docker tag ghcr.io/ecadlabs/signatory:${{ github.sha }}-arm64 ghcr.io/ecadlabs/signatory:${{ github.head_ref || github.ref_name }}-arm64;
docker tag ghcr.io/ecadlabs/signatory:${{ github.sha }}-armv7 ghcr.io/ecadlabs/signatory:${{ github.head_ref || github.ref_name }}-armv7;
if: "!startsWith(github.ref, 'refs/tags/v')"

- name: Push Signatory preview images to GH Container Registry
run: >
docker push ghcr.io/ecadlabs/signatory:${{ github.head_ref || github.ref_name }}-amd64;
docker push ghcr.io/ecadlabs/signatory:${{ github.head_ref || github.ref_name }}-arm64;
docker push ghcr.io/ecadlabs/signatory:${{ github.head_ref || github.ref_name }}-armv7;
if: "!startsWith(github.ref, 'refs/tags/v')"

- name: goreleaser release
run: make release
Expand Down
205 changes: 0 additions & 205 deletions .goreleaser-branch.yml

This file was deleted.

Loading