This repository was archived by the owner on May 19, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.45 KB
/
docker-publisher.yml
File metadata and controls
52 lines (43 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# publisher for building and publishing docker image to github packages container registry
name: Publish Docker Image
on:
release:
types:
- created
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
# login to container registry
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# setup php interpreter for composer
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.5
# install composer dependencies
- name: Install backend dependencies
run: composer install --ignore-platform-reqs --no-interaction --no-progress
# install frontend dependencies with npm
- name: Install frontend dependencies
run: npm install --loglevel=error
# build frontend assets
- name: Build assets
run: npm run build
# build and push docker image
- name: Build and push docker image
uses: docker/build-push-action@v4
with:
file: .docker/Dockerfile.prod
context: .
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/code-paste:${{ github.event.release.tag_name }}
ghcr.io/${{ github.repository_owner }}/code-paste:latest