Merge pull request #13 from nrkno/merge/develop-041223 #67
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: Node CI | |
on: | |
push: | |
branches: | |
- '**' | |
tags: | |
- 'v**' | |
workflow_dispatch: | |
jobs: | |
run-yarn-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: yarn install | |
run: yarn install --check-files --frozen-lockfile | |
# - name: yarn validate:dependencies | |
# run: | | |
# if ! git log --format=oneline -n 1 | grep -q "\[ignore-audit\]"; then | |
# yarn validate:dependencies | |
# else | |
# echo "Skipping audit" | |
# fi | |
- name: yarn build | |
run: yarn build | |
- name: yarn unit test | |
run: yarn test | |
docker-release: | |
runs-on: ubuntu-latest | |
needs: [run-yarn-build] | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get the Docker tag for GHCR | |
id: ghcr-tag | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
ghcr.io/${{ github.repository }} | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=tag | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push to GHCR | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
provenance: false | |
labels: ${{ steps.ghcr-tag.outputs.labels }} | |
tags: "${{ steps.ghcr-tag.outputs.tags }}" |