This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da90510
commit 979dc33
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Publish Docker image | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: npm install and build | ||
run: | | ||
npm ci | ||
npm run build | ||
- uses: actions/upload-artifact@main | ||
with: | ||
name: artifacts | ||
path: prod/ | ||
push_to_registry: | ||
name: Push Docker image to GitHub Packages | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: check out the repo | ||
uses: actions/checkout@v4 | ||
- name: get-npm-version | ||
id: package-version | ||
uses: martinbeentjes/npm-get-version-action@master | ||
- name: version dockerfile | ||
uses: docker/setup-buildx-action@v3 | ||
- name: log into GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.CR_PAT }} | ||
- name: push to Github Container Registry | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
ghcr.io/eddiehubcommunity/website:v${{ steps.package-version.outputs.current-version}} | ||
ghcr.io/eddiehubcommunity/website:latest |