50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["tests"]
|
|
types:
|
|
- completed
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Get version
|
|
id: get_version
|
|
run: echo "::set-output name=version::$(cat VERSION)"
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Log in to Docker Hub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: Dockerfile
|
|
push: true
|
|
tags: git.matthiasg.dev/Ninluc/perceptron-viewer/perceptron-viewer:latest, git.matthiasg.dev/Ninluc/perceptron-viewer/perceptron-viewer:${{ steps.get_version.outputs.version }}
|
|
|
|
# notify:
|
|
# needs: build
|
|
# runs-on: ubuntu-latest
|
|
|
|
# steps:
|
|
# - name: Notify Watchtower
|
|
# run: "curl -i -X POST -H \"Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}\" https://watchtower.beermaker.matthiasg.dev/v1/update"
|