Files
neolink/.github/workflows/docker.yml
T
George Hilliard c581ad43f4 Actions: Rename *.yaml to *.yml
The app https://nightly.link/ requires .yml extensions due to a bug:

oprypin/nightly.link#3

Easy enough to change extensions.
2020-12-11 08:30:20 -06:00

41 lines
1.3 KiB
YAML

# A single-shot build-n-pack on Alpine Linux
name: Publish Docker image
on: [push]
jobs:
push_to_registry:
name: Build Docker image
runs-on: ubuntu-latest
steps:
- name: Check token is set
id: vars
shell: bash
run: |
unset HAS_SECRET
if [ -n $SECRET ]; then HAS_SECRET='true' ; fi
echo ::set-output name=HAS_SECRET_TOKEN::${HAS_SECRET}
env:
SECRET: "${{ secrets.DOCKER_TOKEN }}"
- name: Check out the repo
uses: actions/checkout@v2
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
- name: Convert username to lower case for docker
id: string_user
uses: ASzc/change-string-case-action@v1
with:
string: ${{ github.repository_owner }}
- name: Convert repo to lower case for docker
id: string_repo
uses: ASzc/change-string-case-action@v1
with:
string: ${{ github.repository }}
- name: Push to Docker Hub
uses: docker/build-push-action@v1
if: ${{ steps.vars.outputs.HAS_SECRET_TOKEN }}
with:
username: ${{ steps.string_user.outputs.lowercase }}
password: ${{ secrets.DOCKER_TOKEN }}
registry: docker.io
repository: ${{ steps.string_repo.outputs.lowercase }}
tag_with_ref: true