0
0
Fork 0
mirror of https://github.com/alerta/alerta-webui.git synced 2025-03-18 06:12:51 +00:00
alerta_alerta-webui/.github/workflows/docker.yml

49 lines
1.2 KiB
YAML
Raw Normal View History

name: Docker
on:
push:
branches: [ master, release/* ]
tags: [ '**' ]
2021-01-05 20:56:16 +00:00
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
build:
name: Build & Push
runs-on: ubuntu-latest
2023-03-18 21:41:30 +00:00
env:
REPOSITORY_URL: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/alerta-webui
2023-03-18 21:41:30 +00:00
steps:
2024-04-10 14:42:50 +00:00
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '14'
- run: npm version
2023-03-18 21:41:30 +00:00
- name: Build Image
2020-05-08 17:31:41 +00:00
id: docker-build
run: >-
docker build
-t $IMAGE_NAME
-t $REPOSITORY_URL/$IMAGE_NAME:$(cat VERSION)
-t $REPOSITORY_URL/$IMAGE_NAME:$(git rev-parse --short HEAD)
-t $REPOSITORY_URL/$IMAGE_NAME:latest .
- name: Docker Login
2023-03-18 21:41:30 +00:00
uses: docker/login-action@v2
2021-11-13 22:53:34 +00:00
with:
registry: ${{ env.REPOSITORY_URL }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Image
2020-05-08 17:31:41 +00:00
id: docker-push
run: docker push --all-tags $REPOSITORY_URL/$IMAGE_NAME
2020-05-08 17:31:41 +00:00
2023-03-18 21:41:30 +00:00
- uses: act10ns/slack@v2
2020-04-21 08:16:46 +00:00
with:
status: ${{ job.status }}
2020-05-08 17:31:41 +00:00
steps: ${{ toJson(steps) }}
2020-11-26 19:50:37 +00:00
if: failure()