v14.4.1 #19
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
--- | |
# | |
# Documentation: | |
# https://help.github.com/en/articles/workflow-syntax-for-github-actions | |
# | |
####################################### | |
# Start the job on all push to master # | |
####################################### | |
name: 'Build & Deploy - RELEASE' | |
on: | |
release: | |
# Want to run the automation when a release is created | |
types: ['created'] | |
permissions: read-all | |
concurrency: | |
group: ${{ github.ref_name }}-${{ github.workflow }} | |
cancel-in-progress: true | |
############### | |
# Set the Job # | |
############### | |
jobs: | |
deploy_to_npm: | |
name: Deploy to NPM (release) | |
runs-on: ubuntu-latest | |
permissions: read-all | |
environment: | |
name: release | |
steps: | |
- uses: actions/checkout@v4 | |
# Setup .npmrc file to publish to npm | |
- uses: actions/setup-node@v3.8.1 | |
with: | |
node-version: "18.x" | |
registry-url: "https://registry.npmjs.org" | |
scope: nvuillam | |
- run: npm ci | |
- run: | | |
git config --global user.name nvuillam | |
git config --global user.email nicolas.vuillamy@gmail.com | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# Build & push docker image (release) | |
build_push_docker: | |
name: Build & Push Docker image (release) | |
needs: deploy_to_npm | |
runs-on: ubuntu-latest | |
permissions: read-all | |
environment: | |
name: release | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
# Build & push docker image (beta) | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Get current date | |
run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> ${GITHUB_ENV} | |
- name: Build & Push Docker Image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: Dockerfile | |
platforms: linux/amd64 | |
build-args: | | |
BUILD_DATE=${{ env.BUILD_DATE }} | |
BUILD_REVISION=${{ github.sha }} | |
BUILD_VERSION=${{ github.event.release.tag_name }} | |
NPM_GROOVY_LINT_VERSION=latest | |
load: false | |
push: true | |
tags: | | |
nvuillam/npm-groovy-lint:${{ github.event.release.tag_name }} | |
nvuillam/npm-groovy-lint:latest |