Bump the npm_and_yarn group across 1 directory with 2 updates #23
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: Build and publish image | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: ["main"] | |
paths: | |
- src/** | |
- Dockerfile | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build and publish image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.17 | |
- name: Install dependencies | |
run: npm ci | |
- name: Log in to Docker Hub | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/[email protected] | |
with: | |
images: ${{ github.repository }} | |
tags: | | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=ref,event=pr | |
- name: Build and push Docker image | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Notify on failure | |
if: ${{ failure() }} | |
env: | |
DISCORD_MESSAGE: "Workflow failed at: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
run: | | |
curl -H "Content-Type: application/json" \ | |
-d '{"username": "${{ github.repository }}/${{ github.workflow }}", "content": "${{ env.DISCORD_MESSAGE }}"}' \ | |
"${{ secrets.DISCORD_ALERTS_WEBHOOK }}" | |