Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

v0.2.0

v0.2.0 #6

Workflow file for this run

name: Publish Docker
permissions: read-all
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: npm install and build
run: |
npm ci
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> .env
npm run build
- name: Save .env as artifact
uses: actions/upload-artifact@v4
with:
name: env-file
path: .env
- uses: actions/upload-artifact@v4
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: Download .env artifact
# uses: actions/download-artifact@v4
# with:
# name: env-file
# path: .
- name: npm install
run: |
npm ci
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> .env
- 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/trending:v${{ steps.package-version.outputs.current-version }}
ghcr.io/eddiehubcommunity/trending:latest