forked from XTLS/Xray-core
-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
57dcd9e
commit db0253c
Showing
1 changed file
with
28 additions
and
46 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,63 +1,45 @@ | ||
name: Build docker image | ||
name: Build Docker Image | ||
|
||
on: | ||
release: | ||
types: [published] | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
pull_request: | ||
|
||
env: | ||
APP: amnezia-xray-core | ||
|
||
jobs: | ||
build-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
name: build-image | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ github.repository_owner }}/amnezia-xray-core | ||
flavor: latest=true | ||
tags: | | ||
type=sha | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
- name: Login to GitHub Container Registry | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Setup metadata | ||
uses: docker/metadata-action@v5 | ||
id: metadata | ||
with: | ||
images: amneziavpn/${{ env.APP }} | ||
tags: type=semver,pattern={{version}} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64 | ||
linux/loong64 | ||
linux/riscv64 | ||
provenance: false | ||
file: .github/docker/Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
- name: Build and push Loyalsoldier flavor | ||
|
||
- name: Build | ||
uses: docker/build-push-action@v6 | ||
env: | ||
DOCKER_BUILD_SUMMARY: false | ||
with: | ||
context: . | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64 | ||
linux/loong64 | ||
linux/riscv64 | ||
provenance: false | ||
file: .github/docker/Dockerfile | ||
build-args: flavor=loyalsoldier | ||
push: true | ||
tags: | | ||
${{ steps.loyalsoldier.outputs.tags }} | ||
push: ${{ contains(github.ref, 'refs/tags/') }} # push if tag was set | ||
tags: ${{ steps.metadata.outputs.tags }} |