Skip to content

deploy

deploy #9

Workflow file for this run

name: deploy
on:
release:
types: [published]
jobs:
build:
environment: production
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: |
cd Docker
docker build -t ${{ github.repository }}:latest .
- name: Login Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: |
/tmp/.buildx-cache
${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ github.repository }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:Docker"
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: |
type=local,src=/tmp/.buildx-cache
type=local,src=${{ steps.composer-cache.outputs.dir }}
cache-to: |
type=local,dest=/tmp/.buildx-cache
type=local,dest=${{ steps.composer-cache.outputs.dir }}