Skip to content

Update main.yml

Update main.yml #2

Workflow file for this run

name: Docker Image
on:
workflow_dispatch:
push:
branches: ["master"]
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get current date
id: date
run: echo "date=$(date +%s)" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ secrets.DOCKER_USER }}/${{ github.event.repository.name }}:latest, ${{ secrets.DOCKER_USER }}/${{ github.event.repository.name }}:${{ steps.date.outputs.date }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy
run: |
curl -X POST ${{ secrets.PORTAINER_WEBHOOK }}