Compare commits

..

5 Commits

Author SHA1 Message Date
99905f98d0 Merge pull request 'fix/ci-cd-push' (#45) from fix/ci-cd-push into master
All checks were successful
Compile the repository / compile (push) Successful in 10s
Reviewed-on: #45
2023-06-17 12:16:13 +02:00
1e6a75687a add package version extraction to docker push job
All checks were successful
Compile the repository / compile (push) Successful in 9s
2023-06-17 01:31:03 +02:00
2c09033c3f add new tag restriction to docker push job
All checks were successful
Compile the repository / compile (push) Successful in 9s
2023-06-17 01:27:49 +02:00
ce4441cee3 add restriction to master branch on docker push job
All checks were successful
Compile the repository / compile (push) Successful in 9s
Build a docker image for node-jellyfin-role-bot / build-docker-image (push) Has been skipped
2023-06-17 01:22:53 +02:00
7c8072b295 add separate compile step
should be run on every push to a branch to check for compilability
2023-06-17 01:20:54 +02:00
2 changed files with 25 additions and 2 deletions

View File

@ -0,0 +1,17 @@
name: Compile the repository
on: [push]
env:
REGISTRY: gitea.brudi.xyz
IMAGE_NAME: ${{ gitea.repository }}
USER: ${{ gitea.actor }}
jobs:
compile:
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build Container
run: docker build -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" .

View File

@ -1,6 +1,9 @@
name: Build a docker image for node-jellyfin-role-bot name: Build a docker image for node-jellyfin-role-bot
run-name: ${{ gitea.actor }} is building an image run-name: ${{ gitea.actor }} is building an image
on: [push] on:
push:
tags:
- '*'
env: env:
REGISTRY: gitea.brudi.xyz REGISTRY: gitea.brudi.xyz
IMAGE_NAME: ${{ gitea.repository }} IMAGE_NAME: ${{ gitea.repository }}
@ -8,6 +11,7 @@ env:
jobs: jobs:
build-docker-image: build-docker-image:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: gitea.ref == 'refs/heads/master'
container: catthehacker/ubuntu:act-latest container: catthehacker/ubuntu:act-latest
permissions: permissions:
contents: read contents: read
@ -15,9 +19,11 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Get Package Version
run: VERSION = node -p "require('./package.json').version"
- name: Log in to the Container registry - name: Log in to the Container registry
run: docker login -u ${{ env.USER }} -p ${{ secrets.TOKEN }} ${{ env.REGISTRY }} run: docker login -u ${{ env.USER }} -p ${{ secrets.TOKEN }} ${{ env.REGISTRY }}
- name: Build Container - name: Build Container
run: docker build -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" . run: docker build -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}".
- name: Push Container - name: Push Container
run: docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" run: docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"