Skip to content

Commit

Permalink
github workflow: spectric release and test
Browse files Browse the repository at this point in the history
Replaces the spectric.yml workflow with a release and test
that builds based on any push, or a release (i.e. tagged)
  • Loading branch information
dpew committed Nov 7, 2022
1 parent 1cccc21 commit f3e3ae6
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 87 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/spectric-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Publish Spectric Docker Image"

on:
workflow_run:
workflows: ["Build"]
types: [completed]
tags: '*'

env:
REGISTRY: ghcr.io

jobs:
build-and-push-image:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v2
- uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v4
id: meta
with:
images: ${{ env.REGISTRY }}/spectriclabs/pygeoapi
tags: |
type=ref,event=tag
type=raw,value=latest
- uses: docker/build-push-action@v3.1.1
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
43 changes: 43 additions & 0 deletions .github/workflows/spectric-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Build and Publish Test Docker Image"

on:
workflow_run:
workflows: ["Build"]
types: [completed]
branches: ['spectric',
'master']

env:
REGISTRY: ghcr.io

jobs:
build-and-push-test-image:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Create timestamp env
run: echo "timestamp=$(date --utc +%Y%m%d%H%M%S)" >> $GITHUB_ENV
shell: bash
- uses: actions/checkout@v2
- uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v4
id: meta
with:
images: ${{ env.REGISTRY }}/spectriclabs/pygeoapi
tags: |
type=raw,value=${{ env.timestamp }}
type=raw,value=test
- uses: docker/build-push-action@v3.1.1
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
87 changes: 0 additions & 87 deletions .github/workflows/spectric.yml

This file was deleted.

0 comments on commit f3e3ae6

Please sign in to comment.