sharex-php-uploader/.gitea/workflows/upload-image-dev.yaml

62 lines
1.8 KiB
YAML
Raw Normal View History

2023-07-08 00:07:43 +00:00
name: Publish Docker Image (Development)
2023-07-06 00:04:32 +00:00
on:
push:
branches:
- "development"
jobs:
docker:
runs-on: ubuntu-20.04
steps:
- name: Checkout
2023-07-08 00:07:43 +00:00
uses: actions/checkout@v3
2023-07-06 00:04:32 +00:00
2023-07-08 00:08:41 +00:00
- name: Restore Docker Cache
2023-07-08 00:01:21 +00:00
uses: actions/cache@v3
2023-07-08 00:00:12 +00:00
id: docker-cache
with:
path: /usr/bin/docker
2023-07-08 00:01:21 +00:00
key: ${{ runner.os }}-docker
2023-07-08 00:00:12 +00:00
2023-07-08 00:02:19 +00:00
- name: Install Docker (if not cached)
2023-07-08 00:00:12 +00:00
if: steps.docker-cache.outputs.cache-hit != 'true'
2023-07-06 00:04:32 +00:00
run: |
wget -q -O /tmp/docker.tgz https://download.docker.com/linux/static/stable/x86_64/docker-20.10.23.tgz \
&& tar --extract --file /tmp/docker.tgz --directory /usr/bin --strip-components 1 --no-same-owner docker/docker \
2023-07-08 00:02:19 +00:00
&& rm -rf /tmp/* &&
echo "Done"
2023-07-06 00:04:32 +00:00
- name: Set up Docker Buildx
2023-07-08 00:07:43 +00:00
uses: docker/setup-buildx-action@v2
2023-07-06 00:04:32 +00:00
- name: Login to Repo
2023-07-08 00:07:43 +00:00
uses: docker/login-action@v2
2023-07-06 00:04:32 +00:00
with:
username: ${{ secrets.REPO_USERNAME }}
password: ${{ secrets.REPO_TOKEN }}
2023-07-08 00:05:18 +00:00
- name: Restore Docker Build Cache
uses: actions/cache@v3
2023-07-08 00:07:43 +00:00
id: build-cache
with:
path: /tmp/.buildx-cache
2023-07-08 00:05:18 +00:00
key: ${{ runner.os }}-buildx
2023-07-06 00:04:32 +00:00
- name: Build and Push
uses: docker/build-push-action@v4
with:
push: true
context: .
2023-07-08 00:07:43 +00:00
tags: fascinated/sharex-php-uploader:development
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
2023-07-08 00:05:18 +00:00
- name: Save Docker Build Cache
2023-07-08 00:07:43 +00:00
if: steps.build-cache.outputs.cache-hit != 'true'
run: |
mkdir -p /tmp/.buildx-cache
cp -r /tmp/.buildx-cache/. /tmp/.buildx-cache-new
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache