Skip to content

Commit fc0350c

Browse files
author
Miłosz Skaza
authored
add docker build workflow (#46)
1 parent 29bce6a commit fc0350c

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Diff for: .github/workflows/docker.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build Docker
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
build-and-push-docker:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
- name: Set up QEMU
13+
uses: docker/setup-qemu-action@v2
14+
- name: Set up Docker Buildx
15+
uses: docker/setup-buildx-action@v2
16+
- name: Login to GitHub Container Registry
17+
uses: docker/login-action@v2
18+
with:
19+
registry: ghcr.io
20+
username: ${{ github.repository_owner }}
21+
password: ${{ secrets.CR_PAT }}
22+
- name: Extract version
23+
run: |
24+
export VERSION=`node -e "console.log(require('./package').version)"`
25+
echo "version=$VERSION" >> $GITHUB_OUTPUT
26+
id: extract_version
27+
- name: Build and push latest
28+
uses: docker/build-push-action@v3
29+
with:
30+
push: true
31+
tags: |
32+
ghcr.io/ctfd/tourist:latest
33+
ghcr.io/ctfd/tourist:${{ steps.extract_version.outputs.version }}

0 commit comments

Comments
 (0)