Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
👷 Update GitHub Actions to latest versions
Browse files Browse the repository at this point in the history
  • Loading branch information
TilBlechschmidt committed Mar 6, 2021
1 parent 58679c9 commit caee9cf
Showing 1 changed file with 104 additions and 20 deletions.
124 changes: 104 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,43 @@ jobs:
name: api-executable
path: .artifacts/api-executable

- name: Build and push webgrid/api Docker image
uses: docker/build-push-action@v1
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=webgrid/api
VERSION=edge
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
elif [[ $GITHUB_REF == refs/pull/* ]]; then
VERSION=pr-${{ github.event.number }}
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
if [ "${{ github.event_name }}" = "push" ]; then
TAGS="$TAGS,${DOCKER_IMAGE}:sha-${GITHUB_SHA::8}"
fi
echo "version=${VERSION}" >> $GITHUB_ENV
echo "tags=${TAGS}" >> $GITHUB_ENV
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v1
with:
dockerfile: distribution/docker/images/api/Dockerfile
username: webgrid
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: webgrid/api
tag_with_ref: true
push: ${{ startsWith(github.ref, 'refs/tags/') }}

- name: Build and push webgrid/api Docker image
uses: docker/build-push-action@v2
with:
context: .
file: distribution/docker/images/api/Dockerfile
tags: ${{ env.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.created=${{ env.created }}
org.opencontainers.image.revision=${{ github.sha }}
publish-core:
name: 🐳 Publish Core to Docker Hub
Expand All @@ -86,15 +114,43 @@ jobs:
name: core-executable
path: .artifacts/core-executable

- name: Build and push webgrid/core Docker image
uses: docker/build-push-action@v1
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=webgrid/core
VERSION=edge
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
elif [[ $GITHUB_REF == refs/pull/* ]]; then
VERSION=pr-${{ github.event.number }}
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
if [ "${{ github.event_name }}" = "push" ]; then
TAGS="$TAGS,${DOCKER_IMAGE}:sha-${GITHUB_SHA::8}"
fi
echo "version=${VERSION}" >> $GITHUB_ENV
echo "tags=${TAGS}" >> $GITHUB_ENV
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v1
with:
dockerfile: distribution/docker/images/core/Dockerfile
username: webgrid
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: webgrid/core
tag_with_ref: true
push: ${{ startsWith(github.ref, 'refs/tags/') }}

- name: Build and push webgrid/core Docker image
uses: docker/build-push-action@v2
with:
context: .
file: distribution/docker/images/core/Dockerfile
tags: ${{ env.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.created=${{ env.created }}
org.opencontainers.image.revision=${{ github.sha }}
publish-node:
name: 🐳 Publish Node to Docker Hub
Expand All @@ -111,16 +167,44 @@ jobs:
name: core-executable
path: .artifacts/core-executable

- name: Build and push webgrid/node-${{ matrix.browser }} Docker image
uses: docker/build-push-action@v1
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=webgrid/node-${{ matrix.browser }}
VERSION=edge
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
elif [[ $GITHUB_REF == refs/pull/* ]]; then
VERSION=pr-${{ github.event.number }}
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
if [ "${{ github.event_name }}" = "push" ]; then
TAGS="$TAGS,${DOCKER_IMAGE}:sha-${GITHUB_SHA::8}"
fi
echo "version=${VERSION}" >> $GITHUB_ENV
echo "tags=${TAGS}" >> $GITHUB_ENV
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v1
with:
dockerfile: distribution/docker/images/node/Dockerfile
build_args: browser=${{ matrix.browser }}
username: webgrid
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: webgrid/node-${{ matrix.browser }}
tag_with_ref: true
push: ${{ startsWith(github.ref, 'refs/tags/') }}

- name: Build and push webgrid/node-${{ matrix.browser }} Docker image
uses: docker/build-push-action@v2
with:
context: .
file: distribution/docker/images/node/Dockerfile
build-args: browser=${{ matrix.browser }}
tags: ${{ env.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.created=${{ env.created }}
org.opencontainers.image.revision=${{ github.sha }}
publish-docs:
name: 📚 Publish Docs to GitHub Pages
Expand Down Expand Up @@ -186,7 +270,7 @@ jobs:
RELEASE_ASSET_UPLOAD_URL="https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets"
echo "$RELEASE_ASSET_UPLOAD_URL"
echo "::set-env name=RELEASE_ASSET_UPLOAD_URL::$RELEASE_ASSET_UPLOAD_URL"
echo "RELEASE_ASSET_UPLOAD_URL=$RELEASE_ASSET_UPLOAD_URL" >> $GITHUB_ENV
- name: Attach Core executable
uses: actions/upload-release-asset@v1
Expand Down

0 comments on commit caee9cf

Please sign in to comment.