Deploy Dashboard #5
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
name: Dashboard CD | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
packages: write | |
env: | |
NAME: ghcr.io/phantasmlabs/phantasm/dashboard | |
jobs: | |
publish-image: | |
environment: Dashboard | |
name: Publish Docker Image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Get Package Version | |
run: | | |
cd dashboard | |
VERSION=$(npm pkg get version | tr -d '\"') | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Log in to GitHub Container Registry | |
run: echo $PASSWORD | docker login ghcr.io -u $USER --password-stdin | |
env: | |
USER: ${{ github.actor }} | |
PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build Docker Image | |
run: | | |
docker build -t $NAME:$VERSION ./dashboard | |
- name: Push Docker Image to GHCR | |
run: | | |
docker push $NAME:$VERSION |