Add the ability to configure the scopes passed to the authorization r… #31
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: docker | |
on: | |
push: | |
branches: | |
- develop | |
- feature/* | |
- master | |
tags: | |
- '*' | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Compute Tags | |
id: compute_tags | |
run: | | |
branch="${GITHUB_REF#refs/heads/}" | |
tag="${GITHUB_REF#refs/tags/}" | |
if [ "$branch" != "$GITHUB_REF" ]; then | |
branch="$(echo "$branch" | sed -e 's/[^a-zA-Z0-9\-\.]/-/g')" | |
echo "::set-output name=TAGS::boxboat/okta-nginx:commit-${branch}" | |
elif [ "$tag" != "$GITHUB_REF" ]; then | |
latest="" | |
if ! echo "$tag" | grep -qF '-'; then | |
latest=",boxboat/okta-nginx:latest" | |
fi | |
tag="$(echo "$tag" | sed -e 's/[^a-zA-Z0-9\-\.]/-/g')" | |
echo "::set-output name=TAGS::boxboat/okta-nginx:${tag}${latest}" | |
else | |
echo "unable to determine tag" >&2 | |
exit 1 | |
fi | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: "${{ steps.compute_tags.outputs.TAGS }}" |