Obsessed-Yanqing/.github/workflows/main.yml
Workflow config file is invalid. Please check your config file: yaml: line 24: did not find expected key
2023-07-20 22:51:00 +02:00

56 lines
No EOL
1.5 KiB
YAML

name: Docker Build and Push with Version
on:
push:
branches:
- master
- action-test
env:
DOCKER_REGISTRY: r.evannregnault.dev
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
PORTAINER_API_KEY: ${{ secrets.PORTAINER_API_KEY }}
PORTAINER_API_WEBHOOK: ${{ secrets.PORTAINER_API_WEBHOOK }}
jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- name: HTTP Request Action
uses: fjogeleit/http-request-action@v1.14.1
with:
url: ${{ env.PORTAINER_API_WEBHOOK }}
method: 'POST'
customHeaders: '{"X-API-Key": "' + ${{secrets.PORTAINER_API_KEY}} + '"}'
- name: Checkout repository
uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
- name: Install cargo-semver
uses: actions-rs/install@v0.1.2
with:
crate: cargo-get
version: latest
- name: Semver
run:
echo "VERSION=$(cargo get version --pretty)" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
${{ env.DOCKER_REGISTRY }}/obsessed-yanqing:latest
${{ env.DOCKER_REGISTRY }}/obsessed-yanqing:${{ env.VERSION }}