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

Workflow file for this run

name: Build & publish Docker image then deploy
on:
workflow_dispatch:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: install dependencies
run: npm ci
- name: run build
run: npm run build
- uses: actions/upload-artifact@main
with:
name: artifacts
path: build/
push_to_registry:
name: Push Docker image to GitHub Packages
needs: build
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- name: check out the repo
uses: actions/checkout@v2
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: set up Docker builder
uses: docker/setup-buildx-action@v1
- name: log into GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: push to Github Container Registry
uses: docker/build-push-action@v2
with:
context: .
push: true
secrets: |
'GH_TOKEN=${{ secrets.GITHUB_TOKEN }}'
build-args: 'github_token=${{ secrets.GITHUB_TOKEN }}'
tags: |
ghcr.io/eddiehubcommunity/finder:v${{ steps.package-version.outputs.current-version}}
ghcr.io/eddiehubcommunity/finder:latest
# deploy:
# name: deploy to kube cluster
# needs: push_to_registry
# runs-on: ubuntu-latest
# steps:
# - name: check out the repo
# uses: actions/checkout@v2
# - name: get-npm-version
# id: package-version
# uses: martinbeentjes/npm-get-version-action@master
# - uses: Azure/k8s-set-context@v1
# with:
# kubeconfig: ${{ secrets.KUBE_CONFIG }}
# - uses: Azure/[email protected]
# with:
# namespace: 'default'
# manifests: kubernetes/deployment.yaml
# images: 'ghcr.io/eddiehubcommunity/finder:v${{ steps.package-version.outputs.current-version}}'
# kubectl-version: 'latest'