Skip to content

Commit

Permalink
Enable updating Alpine image, small fixes to workflow (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome authored Nov 11, 2021
1 parent 0576ca3 commit 92a30c6
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
versions: ${{ steps.version.outputs.matrix }}
git_tag: ${{ steps.tag.outputs.git_tag }}
docker_platforms: ${{ steps.vars.outputs.docker_platforms }}
sha_long: ${{ steps.vars.outputs.sha_long }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand All @@ -31,17 +32,18 @@ jobs:
- name: Checkout Repository at ${{ steps.tag.outputs.git_tag }}
uses: actions/checkout@v2
with:
ref: v${{ steps.tag.outputs.git_tag }}
ref: refs/tags/v${{ steps.tag.outputs.git_tag }}
- name: Set Base image version
id: version
run: |
# enable after v0.22.0 nginx_alpine=library/nginx:$(grep -m1 "FROM.*nginx.*alpine" <Dockerfile | awk -F"[ :]" '{print $3}')
nginx_alpine=library/nginx:$(grep -m1 "FROM.*nginx.*alpine" <Dockerfile | awk -F"[ :]" '{print $3}')
nginx=library/$(grep -m1 "FROM nginx:" < Dockerfile | awk -F" " '{print $2}')
echo "::set-output name=matrix::[{\"version\": \"${nginx}\", \"distro\": \"debian\"}]" # enable after v0.22.0 , {\"version\": \"${nginx_alpine}\", \"distro\": \"alpine\"}]"
echo "::set-output name=matrix::[{\"version\": \"${nginx}\", \"distro\": \"debian\"}, {\"version\": \"${nginx_alpine}\", \"distro\": \"alpine\"}]"
- name: Set other variables
id: vars
run: |
echo "::set-output name=docker_platforms::$(grep "PLATFORMS:" .github/workflows/docker.yml | awk -F" " '{print $2}')"
echo "::set-output name=sha_long::$(git rev-parse HEAD)"
check:
name: Check if updates are needed
Expand Down Expand Up @@ -79,13 +81,13 @@ jobs:
include:
- os: debian
needs-updating: ${{ needs.check.outputs.needs-updating-debian }}
# - os: alpine
# needs-updating: ${{ needs.check.outputs.needs-updating-alpine }}
- os: alpine
needs-updating: ${{ needs.check.outputs.needs-updating-alpine }}
steps:
- name: Checkout Repository at ${{ needs.variables.outputs.git_tag }}
uses: actions/checkout@v2
with:
ref: v${{ needs.variables.outputs.git_tag }}
ref: refs/tags/v${{ needs.variables.outputs.git_tag }}
if: ${{ matrix.needs-updating == 'true' }}

- name: Output Variables
Expand Down Expand Up @@ -130,6 +132,8 @@ jobs:
tags: |
type=raw,value=${{ needs.variables.outputs.git_tag }}
type=raw,value=nginx-${{ steps.var.outputs.nginx_version }}
labels: |
org.opencontainers.image.revision=${{ needs.variables.outputs.sha_long }}
if: ${{ matrix.needs-updating == 'true' }}

- name: Build and push
Expand Down

0 comments on commit 92a30c6

Please sign in to comment.