Change Github workflow to deploy docker image

This commit is contained in:
2023-09-02 14:03:39 +02:00
parent 3936666ecc
commit 925f4c3f5a
3 changed files with 38 additions and 17 deletions

34
.github/workflows/go-deploy.yml vendored Normal file
View 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

View File

@ -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