2020-11-22 02:28:14 +00:00
|
|
|
name: publish
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types:
|
2022-01-06 15:32:48 +00:00
|
|
|
- created
|
2020-11-22 02:28:14 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-01-06 15:32:48 +00:00
|
|
|
- uses: actions/checkout@v2
|
2022-05-02 02:59:39 +00:00
|
|
|
# Setup .npmrc file to publish to npm
|
2022-01-06 15:32:48 +00:00
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
# Align the version of Node here with ci.yml.
|
2022-05-02 02:59:39 +00:00
|
|
|
node-version: '18'
|
2022-01-06 15:32:48 +00:00
|
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
# Will also (through `prepare` hook): 1. install ./app, and 2. build
|
|
|
|
- run: npm ci --no-fund
|
|
|
|
- run: npm test
|
|
|
|
- run: npm run lint
|
|
|
|
- run: npm publish
|
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
|
2022-01-06 15:14:31 +00:00
|
|
|
docker:
|
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-01-06 15:32:48 +00:00
|
|
|
- name: Build Docker image
|
|
|
|
run: docker build . --file Dockerfile --tag "nativefier/nativefier:latest"
|
2022-01-06 15:14:31 +00:00
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2022-01-06 15:32:48 +00:00
|
|
|
- name: Tag and push Docker image
|
2022-01-06 15:14:31 +00:00
|
|
|
run: |
|
2022-01-06 15:50:00 +00:00
|
|
|
docker tag "nativefier/nativefier:latest" "nativefier/nativefier:${GITHUB_REF_NAME}"
|
2022-01-06 15:32:48 +00:00
|
|
|
docker push "nativefier/nativefier:latest"
|
2022-01-06 15:50:00 +00:00
|
|
|
docker push "nativefier/nativefier:${GITHUB_REF_NAME}"
|