forked from os2loop/os2loop
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (48 loc) · 1.7 KB
/
docker-image.yaml
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
on: push
name: Docker image
jobs:
build:
name: Build and push
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: dom, zip
coverage: none
tools: composer:v2
- name: Install PHP dependencies
run: |
composer install --no-interaction --no-progress
- name: Build theme
working-directory: web/profiles/custom/os2loop/themes/os2loop_theme
run: |
yarn install
yarn build
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
# We only push from the default branch, so no need to login from elsewhere.
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
# Only push the image if this is a push to the default branch.
push: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
context: .
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.version=${{ github.sha }}
org.opencontainers.image.revision=${{ github.sha }}
tags: |
ghcr.io/${{ github.repository }}:latest