Skip to content

Commit

Permalink
CICD push to docker on release (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
nylonee authored Oct 29, 2023
1 parent 49f2cfc commit 3596910
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Docker Image CI
name: Update Docker alpha tag

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/docker-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Update Docker beta tag

on:
push:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest


steps:
- uses: actions/checkout@v3
- name: Set up environment
run: echo "DOCKER_TAG=$(date +%s)" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build the Docker image
run: docker build . --file docker/Dockerfile --tag nylonee/watchlistarr:${DOCKER_TAG}
- name: Push Docker image
run: |
docker tag nylonee/watchlistarr:${DOCKER_TAG} nylonee/watchlistarr:beta
docker push nylonee/watchlistarr:${DOCKER_TAG}
docker push nylonee/watchlistarr:beta
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Docker Release CI

on:
release:
types: [published]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up environment
run: echo "DOCKER_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build the Docker image
run: docker build . --file docker/Dockerfile --tag nylonee/watchlistarr:${DOCKER_TAG}
- name: Push Docker image
run: |
docker tag nylonee/watchlistarr:${DOCKER_TAG} nylonee/watchlistarr:latest
docker push nylonee/watchlistarr:${DOCKER_TAG}
docker push nylonee/watchlistarr:latest

0 comments on commit 3596910

Please sign in to comment.