Skip to content

fetch all history for all tags and branches #12

fetch all history for all tags and branches

fetch all history for all tags and branches #12

name: build and deploy
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build and push
run: |
REPO_LOWERCASE=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')
TAG_BASE=ghcr.io/$REPO_LOWERCASE
docker build . -t $TAG_BASE:${{ github.sha }}
docker tag $TAG_BASE:${{ github.sha }} $TAG_BASE:${{ github.ref_name }}
docker tag $TAG_BASE:${{ github.sha }} $TAG_BASE:latest
docker push --all-tags $TAG_BASE
deploy:
needs: build
runs-on: ubuntu-latest
env:
PORTAINER_WEBHOOK: ${{ secrets.PORTAINER_WEBHOOK }}
steps:
- name: Install curl
run: sudo apt-get install curl
- name: Trigger Portainer Webhook
run: curl -X POST $PORTAINER_WEBHOOK