mirror of
https://github.com/prodrigestivill/docker-postgres-backup-local.git
synced 2026-05-31 08:37:58 +00:00
Simplify workflow
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
- '!master'
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
test:
|
||||
@@ -49,8 +45,10 @@ jobs:
|
||||
run: |
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
sh -xe backup.sh
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.ref != 'refs/heads/main' }}
|
||||
needs: [ test ]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -65,3 +63,38 @@ jobs:
|
||||
|
||||
- name: Build images
|
||||
run: docker buildx bake --pull
|
||||
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
needs: [ test ]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
with:
|
||||
platforms: amd64,arm64,arm/v7,s390x,ppc64le
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Configure build revision
|
||||
id: vars
|
||||
run: echo "::set-output name=sha_short::${GITHUB_SHA:0:7}"
|
||||
|
||||
- name: Build images
|
||||
env:
|
||||
BUILDREV: ${{ steps.vars.outputs.sha_short }}
|
||||
run: docker buildx bake --pull
|
||||
|
||||
- name: Push images
|
||||
env:
|
||||
BUILDREV: ${{ steps.vars.outputs.sha_short }}
|
||||
run: docker buildx bake --push
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
name: Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
with:
|
||||
platforms: amd64,arm64,arm/v7,s390x,ppc64le
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Configure build revision
|
||||
id: vars
|
||||
run: echo "::set-output name=sha_short::${GITHUB_SHA:0:7}"
|
||||
|
||||
- name: Build images
|
||||
env:
|
||||
BUILDREV: ${{ steps.vars.outputs.sha_short }}
|
||||
run: docker buildx bake --pull
|
||||
|
||||
- name: Push images
|
||||
env:
|
||||
BUILDREV: ${{ steps.vars.outputs.sha_short }}
|
||||
run: docker buildx bake --push
|
||||
Reference in New Issue
Block a user