Skip to content

Commit aabd41d

Browse files
committed
Re-added docker image build
1 parent 7d65534 commit aabd41d

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on: push
2+
3+
name: Docker image
4+
jobs:
5+
build:
6+
name: Build and push
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v2
11+
- name: Setup PHP, with composer and extensions
12+
uses: shivammathur/setup-php@v2
13+
with:
14+
php-version: 7.4
15+
extensions: dom, zip
16+
coverage: none
17+
tools: composer:v2
18+
- name: Install PHP dependencies
19+
run: |
20+
composer install --no-interaction --no-progress
21+
- name: Build theme
22+
working-directory: web/profiles/custom/os2loop/themes/os2loop_theme
23+
run: |
24+
yarn install
25+
yarn build
26+
- name: Set up Docker Buildx
27+
id: buildx
28+
uses: docker/setup-buildx-action@v1
29+
- name: Login to GitHub Container Registry
30+
uses: docker/login-action@v1
31+
# We only push from the default branch, so no need to login from elsewhere.
32+
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.repository_owner }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
- name: Build and push Docker image
38+
uses: docker/build-push-action@v2
39+
with:
40+
builder: ${{ steps.buildx.outputs.name }}
41+
# Only push the image if this is a push to the default branch.
42+
push: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
43+
context: .
44+
labels: |
45+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
46+
org.opencontainers.image.version=${{ github.sha }}
47+
org.opencontainers.image.revision=${{ github.sha }}
48+
tags: |
49+
ghcr.io/${{ github.repository }}:latest

0 commit comments

Comments
 (0)