Skip to content

Commit 031fc44

Browse files
Added automation to fetch latest tag
1 parent d9e6adf commit 031fc44

File tree

4 files changed

+85
-23
lines changed

4 files changed

+85
-23
lines changed

.github/workflows/continuous-deployment.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
name: Continuous Deployment
22

3-
on:
4-
push:
5-
branches:
6-
- master
7-
83
jobs:
94
deploy:
105
runs-on: ubuntu-latest

.github/workflows/manual-deployment.yml

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,44 @@ name: Manual Deployment
22

33
on:
44
workflow_dispatch:
5+
schedule:
6+
- cron: '59 23 * * *'
57

68
jobs:
7-
deploy:
9+
release:
810
runs-on: ubuntu-latest
911

1012
steps:
11-
- uses: actions/checkout@v1
13+
- uses: actions/checkout@v2
1214
with:
13-
fetch-depth: 1
15+
fetch-depth: 0
1416

15-
- name: Login to Docker Registry
16-
uses: docker/login-action@v1
17+
- id: latest_tag
18+
uses: thebritican/[email protected]
1719
with:
18-
registry: registry.moveyourdigital.dev
19-
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
20-
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
20+
github_token: ${{ github.token }}
21+
repo_path: actions/runner
2122

22-
- name: Build and Push to Docker Registry
23-
uses: docker/build-push-action@v2
24-
with:
25-
context: .
26-
platforms: linux/amd64
27-
push: true
28-
tags: registry.moveyourdigital.dev/github/actions-runner:latest
23+
- id: output
24+
run: "echo 'RUNNER_VERSION=\"${{ steps.latest_tag.outputs.tag_name }}\"'"
25+
26+
# - name: Update Dockerfile RUNNER_VERSION org
27+
# run: sed -i.bak "s/RUNNER_VERSION.*/RUNNER_VERSION=\"${steps.latest_tag.outputs.}\"/" Dockerfile
28+
29+
# - name: Login to Docker Registry
30+
# uses: docker/login-action@v1
31+
# with:
32+
# registry: registry.moveyourdigital.dev
33+
# username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
34+
# password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
35+
36+
# - name: Build and Push to Docker Registry
37+
# uses: docker/build-push-action@v2
38+
# with:
39+
# context: .
40+
# platforms: linux/amd64
41+
# push: true
42+
# tags: registry.moveyourdigital.dev/github/actions-runner:latest
2943

30-
- name: Image digest
31-
run: echo ${{ steps.docker_build.outputs.digest }}
44+
# - name: Image digest
45+
# run: echo ${{ steps.docker_build.outputs.digest }}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Update Version
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '59 23 * * *'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
17+
- id: fetch-latest-release
18+
uses: thebritican/[email protected]
19+
with:
20+
github_token: ${{ github.token }}
21+
repo_path: actions/runner
22+
23+
- id: commit
24+
run: |
25+
TAG=${{ steps.fetch-latest-release.outputs.tag_name }}
26+
sed -i.bak "s/RUNNER_VERSION.*/RUNNER_VERSION=\"${TAG:1}\"/" Dockerfile
27+
if [[ `git status -uno --porcelain` ]]; then
28+
git config --global user.name 'lightningspirit [Automated 🤖]'
29+
git config --global user.email '[email protected]'
30+
git commit -am "Bump to $TAG"
31+
git push
32+
fi
33+
34+
# - name: Update Dockerfile RUNNER_VERSION org
35+
# run: sed -i.bak "s/RUNNER_VERSION.*/RUNNER_VERSION=\"${steps.latest_tag.outputs.}\"/" Dockerfile
36+
37+
# - name: Login to Docker Registry
38+
# uses: docker/login-action@v1
39+
# with:
40+
# registry: registry.moveyourdigital.dev
41+
# username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
42+
# password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
43+
44+
# - name: Build and Push to Docker Registry
45+
# uses: docker/build-push-action@v2
46+
# with:
47+
# context: .
48+
# platforms: linux/amd64
49+
# push: true
50+
# tags: registry.moveyourdigital.dev/github/actions-runner:latest
51+
52+
# - name: Image digest
53+
# run: echo ${{ steps.docker_build.outputs.digest }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
FROM ubuntu:21.04
33

44
# set the github runner version
5-
ARG RUNNER_VERSION="2.293.0"
5+
ARG RUNNER_VERSION="2.287.0"
66

77
ENV TZ=Europe/Lisbon
88
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

0 commit comments

Comments
 (0)