Skip to content

Commit

Permalink
Merge pull request #1 from nlnwa/workflows
Browse files Browse the repository at this point in the history
Update github workflows
  • Loading branch information
maeb authored Nov 18, 2022
2 parents ab0a961 + eb5d178 commit 1b49cd5
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 70 deletions.
70 changes: 0 additions & 70 deletions .github/workflows/docker-publish.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
tags:
- 'v*'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
release:
name: Build and publish docker image
runs-on: ubuntu-latest
steps:
- name: Extract metadata (tags, labels) and establish version
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
- name: Log in to the container registry (${{ env.REGISTRY }})
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
31 changes: 31 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test

on:
pull_request: { }

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

permissions:
contents: read

jobs:
test:
name: Build docker image
runs-on: ubuntu-latest
steps:
- name: Extract metadata (tags, labels) and establish version
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=pr
- name: Build and push
uses: docker/build-push-action@v3
with:
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 1b49cd5

Please sign in to comment.