v3.12.0 #14
Workflow file for this run
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: Release | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm install | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
docker-build-and-publish: | |
name: "Docker: Build & Publish" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Config: Registry" | |
run: echo "REGISTRY=ghcr.io" >> $GITHUB_ENV | |
- name: "Config: Image Name" | |
run: echo "IMAGE_NAME=${{ github.repository_owner }}/$(basename ${{ github.repository }})" >> $GITHUB_ENV | |
- name: "Config: Image URL" | |
run: echo "IMAGE_URL=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" >> $GITHUB_ENV | |
# Derriving semver tags this way is hacky, but the action doesn't seem to think you would want to set | |
# both latest AND semver... | |
- name: "Config: Semver Tags" | |
run: | | |
echo "SEMVER_TAGS=$(echo ${{ github.ref }} \ | |
| sed -e 's/refs\/tags\///g' \ | |
| sed -E 's/v?([0-9]+)\.([0-9]+)\.([0-9]+)(-[a-zA-Z]+(\.[0-9]+)?)?/\1.\2.\3\4\,\1.\2\4\,\1\4/g')" >> $GITHUB_ENV | |
- name: "Repo: Checkout" | |
uses: actions/checkout@v3 | |
- name: "Docker: Build & Publish" | |
id: build | |
uses: elgohr/Publish-Docker-Github-Action@v5 | |
with: | |
name: ${{ env.IMAGE_NAME }} | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.PUBLISH_TOKEN }} | |
tags: latest,stable,${{ env.SEMVER_TAGS }} |