mirror of
https://github.com/restic/rest-server.git
synced 2025-10-19 15:43:21 +00:00
Add workflow to publish Docker images
This commit is contained in:
parent
d7db672c01
commit
1d84aac57e
1 changed files with 44 additions and 0 deletions
44
.github/workflows/dockerpush.yml
vendored
Normal file
44
.github/workflows/dockerpush.yml
vendored
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
name: Publish Docker image
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*.*.*"
|
||||||
|
jobs:
|
||||||
|
main:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Save tag in env variable
|
||||||
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Save repo in env variable
|
||||||
|
run: echo "REPO_NAME=${{ github.event.repository.name }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Print release and repo name for debugging
|
||||||
|
run: |
|
||||||
|
echo $RELEASE_VERSION
|
||||||
|
echo $REPO_NAME
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
id: docker_build
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
restic/${{ env.REPO_NAME }}:latest
|
||||||
|
restic/${{ env.REPO_NAME }}:${{ env.RELEASE_VERSION }}
|
||||||
|
platforms: linux/amd64,linux/arm/v7
|
Loading…
Add table
Add a link
Reference in a new issue