forked from os2loop/os2loop
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/d-10-prepare
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |