-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
40 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 |
---|---|---|
|
@@ -125,3 +125,43 @@ jobs: | |
labels: ${{ steps.docker_meta.outputs.labels }} | ||
build-args: | | ||
VERSION=${{ github.sha }} | ||
DockerLegacy: | ||
# only publish if tests passed | ||
needs: test | ||
# secrets are not available for PR from forks, and dependabot PRs, we don't want to build them | ||
if: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' }} | ||
runs-on: ubuntu-latest | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Docker meta | ||
id: docker_meta | ||
uses: docker/[email protected] | ||
with: | ||
images: ghcr.io/c2corg/v6_api | ||
flavor: | | ||
latest=auto | ||
prefix= | ||
suffix=-legacy,onlatest=true | ||
tags: | | ||
type=semver,pattern={{version}} | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
- run: git archive --format=tar --output project.tar "$GITHUB_SHA" | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
version: v0.9.1 # use pre 10 version of buildx | ||
- name: Publish the docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.docker_meta.outputs.tags }} | ||
labels: ${{ steps.docker_meta.outputs.labels }} | ||
build-args: | | ||
VERSION=${{ github.sha }} |