-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (43 loc) · 1.47 KB
/
docker-build.yml
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
name: Docker Build voting
on:
workflow_dispatch:
push:
tags:
- v*
branches:
- main
jobs:
build:
name: Docker build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: buildpacks/github-actions/[email protected]
- name: Extract metadata for the Docker image
id: meta
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea
with:
images: ghcr.io/beer4peer/voting
- id: build
name: Build and Publish container
env:
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
HEROKU_PHP_PLATFORM_REPOSITORIES: https://heroku-php-extensions.s3.amazonaws.com/dist-heroku-20-stable/packages.json
APP_ENV: production
run: |
pack build ghcr.io/beer4peer/voting \
--tag ghcr.io/beer4peer/voting:${{ github.ref_name }}-$(git rev-parse --short HEAD)-$(date +%s) \
--tag $(echo "${{ steps.meta.outputs.tags }}" | xargs | sed 's/ / --tag /') \
--env "HEROKU_PHP_PLATFORM_REPOSITORIES" \
--env "FONTAWESOME_NPM_AUTH_TOKEN" \
--env "APP_ENV" \
-B heroku/buildpacks:20 \
-b heroku/nodejs \
-b heroku/php \
--publish