Skip to content

Update docker.yml

Update docker.yml #5

Workflow file for this run

name: Docker
on:
push:
branches: [main]
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
FTP_SERVER: ftpupload.net
FTP_USER: ${{ secrets.FTP_USER }}
FTP_PASS: ${{ secrets.FTP_PASS }}
jobs:
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and Push Image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Deploy via FTP
run: |
find . -type f -exec curl -X POST -u "${{ env.FTP_USER }}:${{ env.FTP_PASS }}" \
--ftp-ssl "${{ env.FTP_SERVER }}/api.ahft.me/htdocs/" \
-T {} \;