2020-06-01 18:27:26 +08:00
|
|
|
name: Docker beta build
|
2020-05-28 15:22:17 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
jobs:
|
|
|
|
build:
|
2021-04-27 00:52:03 +08:00
|
|
|
if: github.repository == 'rclone/rclone'
|
2020-05-28 15:22:17 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Build image job
|
|
|
|
steps:
|
2023-10-10 16:55:07 +08:00
|
|
|
- name: Free some space
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
df -h .
|
|
|
|
# Remove android SDK
|
|
|
|
sudo rm -rf /usr/local/lib/android || true
|
|
|
|
# Remove .net runtime
|
|
|
|
sudo rm -rf /usr/share/dotnet || true
|
|
|
|
df -h .
|
2020-05-28 15:22:17 +08:00
|
|
|
- name: Checkout master
|
2023-09-05 06:14:49 +08:00
|
|
|
uses: actions/checkout@v4
|
2020-06-01 18:27:26 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-03-17 19:54:01 +08:00
|
|
|
- name: Login to Docker Hub
|
2023-09-13 06:59:27 +08:00
|
|
|
uses: docker/login-action@v3
|
2023-03-17 19:54:01 +08:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
|
|
id: meta
|
2023-09-13 06:59:29 +08:00
|
|
|
uses: docker/metadata-action@v5
|
2023-03-17 19:54:01 +08:00
|
|
|
with:
|
|
|
|
images: ghcr.io/${{ github.repository }}
|
|
|
|
- name: Set up QEMU
|
2023-09-15 16:16:15 +08:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2023-03-17 19:54:01 +08:00
|
|
|
- name: Set up Docker Buildx
|
2023-09-13 22:56:51 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-03-17 19:54:01 +08:00
|
|
|
- name: Login to GitHub Container Registry
|
2023-09-13 06:59:27 +08:00
|
|
|
uses: docker/login-action@v3
|
2023-03-17 19:54:01 +08:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
# This is the user that triggered the Workflow. In this case, it will
|
|
|
|
# either be the user whom created the Release or manually triggered
|
|
|
|
# the workflow_dispatch.
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
# `secrets.GITHUB_TOKEN` is a secret that's automatically generated by
|
|
|
|
# GitHub Actions at the start of a workflow run to identify the job.
|
|
|
|
# This is used to authenticate against GitHub Container Registry.
|
|
|
|
# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
|
|
|
|
# for more detailed information.
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2023-10-10 16:55:07 +08:00
|
|
|
- name: Show disk usage
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
df -h .
|
2020-05-28 15:22:17 +08:00
|
|
|
- name: Build and publish image
|
2024-06-18 06:56:03 +08:00
|
|
|
uses: docker/build-push-action@v6
|
2020-05-28 15:22:17 +08:00
|
|
|
with:
|
2023-03-20 19:54:31 +08:00
|
|
|
file: Dockerfile
|
2023-03-17 19:54:01 +08:00
|
|
|
context: .
|
|
|
|
push: true # push the image to ghcr
|
|
|
|
tags: |
|
|
|
|
ghcr.io/rclone/rclone:beta
|
|
|
|
rclone/rclone:beta
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
2023-03-22 00:25:46 +08:00
|
|
|
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6
|
2023-10-10 16:55:07 +08:00
|
|
|
cache-from: type=gha, scope=${{ github.workflow }}
|
|
|
|
cache-to: type=gha, mode=max, scope=${{ github.workflow }}
|
2023-03-21 02:09:54 +08:00
|
|
|
provenance: false
|
2023-03-17 19:54:01 +08:00
|
|
|
# Eventually cache will need to be cleared if builds more frequent than once a week
|
|
|
|
# https://github.com/docker/build-push-action/issues/252
|
2023-10-10 16:55:07 +08:00
|
|
|
- name: Show disk usage
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
df -h .
|