-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docker build with GH action Set docker filename on build Add docker tag based on branch and version Update docker/metadata-action to v5 Add tag version and support workflow dispatch Set fetc-depth to 0 on docker build Update builder_docker github action Set fetch depth to zero Define version of actions on build_docker workflow Fix version issue Pass docker args Add an echo log on dockerfile for repo and branch Fix build args GIT_REPO URL Set pyvipv8 on docker pythonpath Update compose.yml file Always use the full tag for version Remove extra metadata tags; instead use branch and version Remove configuration file
- Loading branch information
Showing
3 changed files
with
94 additions
and
34 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,21 +1,67 @@ | ||
name: Build Docker Image | ||
name: Publish Docker Image | ||
|
||
on: workflow_dispatch | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'main' | ||
- 'docker' | ||
tags: | ||
- 'v*' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
|
||
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build and export | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref_name }} | ||
fetch-depth: 0 | ||
submodules: 'true' | ||
fetch-tags: 'true' | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract Git Tag Version | ||
id: git_tag_version | ||
run: | | ||
echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV | ||
- name: Build and push Docker image | ||
id: push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
tags: tribler:latest | ||
outputs: type=docker,dest=/tmp/tribler.tar | ||
context: . | ||
file: build/docker/build.Dockerfile | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
push: true | ||
tags: | | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} | ||
build-args: | | ||
GIT_BRANCH=${{ github.ref_name }} | ||
GIT_REPO=https://github.com/${{ github.repository }} | ||
- name: Generate artifact attestation | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
name: tribler | ||
path: /tmp/tribler.tar | ||
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} | ||
subject-digest: ${{ steps.push.outputs.digest }} | ||
push-to-registry: true |
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
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,11 @@ | ||
|
||
services: | ||
tribler: | ||
image: ghcr.io/tribler/tribler:main | ||
network_mode: host | ||
environment: | ||
CORE_API_PORT: 8085 | ||
CORE_API_KEY: "changeme" | ||
volumes: | ||
- ~/.Tribler/git:/home/user/.Tribler | ||
- ~/Downloads/TriblerDownloads:/home/user/Downloads/TriblerDownloads |