Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 979dc33

Browse files
authored
feat: docker registry
1 parent da90510 commit 979dc33

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/docker.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish Docker image
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: npm install and build
12+
run: |
13+
npm ci
14+
npm run build
15+
- uses: actions/upload-artifact@main
16+
with:
17+
name: artifacts
18+
path: prod/
19+
push_to_registry:
20+
name: Push Docker image to GitHub Packages
21+
needs: build
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: check out the repo
25+
uses: actions/checkout@v4
26+
- name: get-npm-version
27+
id: package-version
28+
uses: martinbeentjes/npm-get-version-action@master
29+
- name: version dockerfile
30+
uses: docker/setup-buildx-action@v3
31+
- name: log into GitHub Container Registry
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.repository_owner }}
36+
password: ${{ secrets.CR_PAT }}
37+
- name: push to Github Container Registry
38+
uses: docker/build-push-action@v6
39+
with:
40+
context: .
41+
push: true
42+
tags: |
43+
ghcr.io/eddiehubcommunity/website:v${{ steps.package-version.outputs.current-version}}
44+
ghcr.io/eddiehubcommunity/website:latest

0 commit comments

Comments
 (0)