Skip to content
Snippets Groups Projects
Unverified Commit 5343d48a authored by Niaz's avatar Niaz Committed by GitHub
Browse files

Added creating releases

parent 3009afd1
No related branches found
No related tags found
No related merge requests found
name: backend name: backend
on: on:
release:
types: [created]
push: push:
branches: branches:
- main - main
...@@ -11,7 +13,8 @@ on: ...@@ -11,7 +13,8 @@ on:
env: env:
IMAGE_NAME: librephotos IMAGE_NAME: librephotos
RELEASE_TAG: github.event.release.name
jobs: jobs:
# Run tests. # Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/ # See also https://docs.docker.com/docker-hub/builds/automated-testing/
...@@ -25,11 +28,13 @@ jobs: ...@@ -25,11 +28,13 @@ jobs:
run: echo "To-Do Add Running Tests" run: echo "To-Do Add Running Tests"
build: build:
name: Building dev build
# Ensure test job passes before pushing image. # Ensure test job passes before pushing image.
if: github.event_name != 'release'
needs: test needs: test
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
...@@ -53,3 +58,34 @@ jobs: ...@@ -53,3 +58,34 @@ jobs:
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
push: true push: true
tags: reallibrephotos/librephotos:dev tags: reallibrephotos/librephotos:dev
release-job:
name: Releasing
if: github.event_name == 'release' && github.event.action == 'created'
# Ensure test job passes before pushing image.
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./backend
platforms: linux/amd64,linux/arm64
push: true
tags: reallibrephotos/librephotos:$RELEASE_TAG
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment