Skip to content

Commit

Permalink
ci: add docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
bhunter234 committed Sep 6, 2024
1 parent cb69088 commit 5fca551
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
50 changes: 48 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
push:
tags:
- '**'

env:
IMAGE: tgdrive/rclone


jobs:
build:
timeout-minutes: 60
Expand Down Expand Up @@ -126,6 +131,7 @@ jobs:
with:
name: rclone-${{ matrix.job_name }}
path: ${{ github.workspace }}/build/**/*
retention-days: 1

android:
timeout-minutes: 30
Expand Down Expand Up @@ -210,6 +216,7 @@ jobs:
with:
name: rclone-android
path: ${{ github.workspace }}/build/rclone-*.zip
retention-days: 1

release:
name: Create Release
Expand All @@ -224,13 +231,52 @@ jobs:
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}/build
path: /tmp/build
pattern: rclone-*
merge-multiple: true

- name: Copy Artifacts
run: |
mkdir build
cp -r /tmp/build/* build/
- name: Upload Assets
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
make upload_github
make upload_github
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set Docker metadata
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
labels: |
org.opencontainers.image.version=${{ github.ref_name}}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.title=${{ env.IMAGE }}
org.opencontainers.image.description=Rclone Docker Image
- name: Publish to Docker
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
build-args: |
VERSION=${{ github.ref_name}}
labels: ${{ steps.docker_meta.outputs.labels }}
tags: |
ghcr.io/${{ env.IMAGE }}:${{ github.ref_name}}
ghcr.io/${{ env.IMAGE }}:latest
2 changes: 1 addition & 1 deletion bin/upload-github
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ gh release create "${VERSION}" \
--notes-file "/tmp/${VERSION}-release-notes" \
--draft=true

for build in build/*; do
for build in /tmp/build/*; do
case $build in
*current*) continue ;;
*testbuilds*) continue ;;
Expand Down

0 comments on commit 5fca551

Please sign in to comment.