All checks were successful
Docker Build, Push, and Deploy to Portainer / Build and Push Docker Image (push) Successful in 1m43s
42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
name: Docker Build, Push, and Deploy to Portainer
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
REGISTRY_TOKEN: ${{ secrets.GLOBAL_PACKAGE_TOKEN }}
|
|
REGISTRY_USER: ${{ vars.GLOBAL_ACCOUNT_EMAIL }}
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
name: Build and Push Docker Image
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Login to Gitea Package Regsitry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ vars.REGISTRY_URL }}
|
|
username: ${{ env.REGISTRY_USER }}
|
|
password: ${{ env.REGISTRY_TOKEN }}
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build and Push Docker Image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: true
|
|
tags: |
|
|
${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:latest
|
|
${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ gitea.sha }}
|
|
|
|
- name: Logout from Gitea Package Regsitry
|
|
if: always()
|
|
run: docker logout ${{ vars.REGISTRY_URL }} |