Skip to content

Commit b1079dc

Browse files
authored
Merge pull request #30 from WadeBarnes/main
Add publish workflows
2 parents 6ab6507 + 98aa4e6 commit b1079dc

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/publish.yaml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: bcgov/indy-tails-server - Publish Image
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
# Ensure only the most recent workflow runs.
8+
concurrency:
9+
group: von-network
10+
cancel-in-progress: true
11+
12+
jobs:
13+
publish_to_ghcr:
14+
name: Publish image to ghcr.io
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Check out
18+
uses: actions/checkout@v2
19+
20+
- name: Lowercase repo owner
21+
id: lowercase_repo_owner
22+
uses: ASzc/change-string-case-action@v1
23+
with:
24+
string: ${{ github.repository_owner }}
25+
26+
- name: Setup Image Metadata
27+
id: meta
28+
uses: docker/metadata-action@v3
29+
with:
30+
# list of Docker images to use as base name for tags
31+
images: |
32+
ghcr.io/${{ steps.lowercase_repo_owner.outputs.lowercase }}/tails-server
33+
# generate Docker tags based on the following events/attributes
34+
tags: |
35+
type=schedule
36+
type=ref,event=branch
37+
type=ref,event=pr
38+
type=semver,pattern={{version}}
39+
type=semver,pattern={{major}}.{{minor}}
40+
type=semver,pattern={{major}}
41+
type=sha
42+
43+
- name: Log in to the GitHub Container Registry
44+
uses: docker/login-action@v1
45+
with:
46+
registry: ghcr.io
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Set up Docker Buildx
51+
uses: docker/setup-buildx-action@v1
52+
53+
- name: Build and Push to Docker ghcr.io
54+
uses: docker/build-push-action@v2
55+
with:
56+
push: true
57+
file: docker/Dockerfile.tails-server
58+
context: .
59+
tags: ${{ steps.meta.outputs.tags }}
60+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)