mirror of
https://github.com/pcvolkmer/idicon.git
synced 2025-04-19 16:46:50 +00:00
Change Github workflow to deploy docker image
This commit is contained in:
parent
3936666ecc
commit
925f4c3f5a
34
.github/workflows/go-deploy.yml
vendored
Normal file
34
.github/workflows/go-deploy.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
name: Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "master", "main" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "master", "main" ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: '1.20'
|
||||||
|
|
||||||
|
- run: go test
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to ghcr.io
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Execute image build and push
|
||||||
|
run: |
|
||||||
|
docker build -t ghcr.io/pcvolkmer/idicon .
|
||||||
|
docker push ghcr.io/pcvolkmer/idicon
|
17
.github/workflows/go-test.yml
vendored
17
.github/workflows/go-test.yml
vendored
@ -1,17 +0,0 @@
|
|||||||
name: Go test
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "master", "main" ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ "master", "main" ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-go@v3
|
|
||||||
with:
|
|
||||||
go-version: '1.20'
|
|
||||||
- run: go test
|
|
@ -21,6 +21,10 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app -ldflags '-w -s'
|
|||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
|
||||||
|
LABEL org.opencontainers.image.source = "https://github.com/pcvolkmer/idicon"
|
||||||
|
LABEL org.opencontainers.image.licenses = "MIT"
|
||||||
|
LABEL org.opencontainers.image.description = "Simple identicon service"
|
||||||
|
|
||||||
COPY --from=build-env /etc/passwd /etc/passwd
|
COPY --from=build-env /etc/passwd /etc/passwd
|
||||||
COPY --from=build-env /etc/group /etc/group
|
COPY --from=build-env /etc/group /etc/group
|
||||||
COPY --from=build-env /tmp/build/app /idicon
|
COPY --from=build-env /tmp/build/app /idicon
|
||||||
|
Loading…
x
Reference in New Issue
Block a user