Create and Publish Docker Image #1
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: Create and Publish Docker Image | |
on: | |
workflow_dispatch: # Allows manual triggering from Github portal. | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build full project and Docker image. | |
run: npm run docker | |
- name: Log in to GHCR | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Deploy Docker image to GHCR. | |
run: | | |
docker tag hone-server ghcr.io/${{ github.actor }}/hone-server:latest | |
docker push ghcr.io/${{ github.actor }}/hone-server:latest |