-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve tagging so that containers are not just latest * Remove conditions around PR * Rename job * Add GHCR prefix * Switch to official docker metadata action * Rename and reindent, stupid yaml * Make it use GHCR rather than DockerHub * Remove format owner
- Loading branch information
Showing
1 changed file
with
20 additions
and
15 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 |
---|---|---|
@@ -1,40 +1,45 @@ | ||
name: ci | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Set up QEMU | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
name: Set up Docker Buildx | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Login to GitHub Container Registry | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- id: formatowner | ||
uses: ASzc/change-string-case-action@v1 | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
string: ${{ github.repository_owner }} | ||
- | ||
name: Build and push | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
platforms: linux/amd64 | ||
push: true | ||
tags: | | ||
ghcr.io/${{ steps.formatowner.outputs.lowercase }}/juno:latest | ||
tags: ${{ steps.meta.outputs.tags }} |