-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from uswitch/AIRSHIP-3608-migrate-to-gha
AIRSHIP-3608 migrate to GHA
- Loading branch information
Showing
3 changed files
with
60 additions
and
43 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: push | ||
|
||
on: push | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.20" | ||
- run: make test | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.20" | ||
- run: make bin/vault-webhook-linux-amd64 | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: bin | ||
path: bin/ | ||
|
||
docker-build-push: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: bin | ||
path: bin/ | ||
- name: Login to Quay.io | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
- id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: quay.io/uswitch/vault-webhook | ||
tags: | | ||
type=sha,prefix=,format=long | ||
type=semver,pattern={{raw}} | ||
- uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
labels: ${{ steps.meta.outputs.labels }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
FROM gcr.io/distroless/static:nonroot | ||
|
||
WORKDIR / | ||
COPY bin/vault-webhook-linux-amd64 vault-webhook | ||
COPY --chmod=755 bin/vault-webhook-linux-amd64 vault-webhook | ||
USER nonroot:nonroot | ||
|
||
ENTRYPOINT ["/vault-webhook"] |