2020-07-15 14:40:39 -04:00
|
|
|
name: Docker
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: "0 12 * * *"
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-07-15 16:54:58 -04:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
submodules: true
|
2020-07-15 14:40:39 -04:00
|
|
|
|
2020-07-16 18:51:46 -04:00
|
|
|
- name: Verify signature
|
2020-07-16 20:11:57 -04:00
|
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
2020-07-16 18:51:46 -04:00
|
|
|
uses: ./.github/actions/git-verify-ref
|
2020-07-15 16:24:28 -04:00
|
|
|
|
2020-07-16 18:51:46 -04:00
|
|
|
- name: Run ShellCheck
|
|
|
|
uses: ludeeus/action-shellcheck@master
|
|
|
|
with:
|
|
|
|
ignore: tests/shunit2
|
2020-07-15 14:40:39 -04:00
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: tests/run
|
|
|
|
|
|
|
|
push:
|
2020-07-16 19:09:12 -04:00
|
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
2020-07-15 14:40:39 -04:00
|
|
|
needs: test
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-07-16 20:12:20 -04:00
|
|
|
|
|
|
|
- name: Define tags
|
|
|
|
id: define_tags
|
|
|
|
run: |
|
|
|
|
if [ "$GITHUB_REF" == "refs/heads/master" ]; then
|
|
|
|
echo "::set-output name=tags::debian"
|
|
|
|
else
|
|
|
|
echo "::set-output name=tags::"
|
|
|
|
fi
|
|
|
|
|
2020-07-15 14:40:39 -04:00
|
|
|
- name: Build and push Docker images
|
|
|
|
uses: docker/build-push-action@v1.1.0
|
|
|
|
with:
|
|
|
|
# Username used to log in to a Docker registry. If not set then no login will occur
|
|
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
|
|
# Password or personal access token used to log in to a Docker registry. If not set then no login will occur
|
|
|
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
|
|
# Server address of Docker registry. If not set then will default to Docker Hub
|
|
|
|
#registry: # optional
|
|
|
|
# Docker repository to tag the image with
|
|
|
|
repository: atmoz/sftp
|
|
|
|
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
|
2020-07-16 20:12:20 -04:00
|
|
|
tags: ${{ steps.define_tags.outputs.tags }} # optional
|
2020-07-15 14:40:39 -04:00
|
|
|
# Automatically tags the built image with the git reference as per the readme
|
|
|
|
tag_with_ref: true # optional
|
|
|
|
# Automatically tags the built image with the git short SHA as per the readme
|
|
|
|
tag_with_sha: false # optional
|
|
|
|
# Path to the build context
|
|
|
|
#path: # optional, default is .
|
|
|
|
# Path to the Dockerfile (Default is '{path}/Dockerfile')
|
|
|
|
#dockerfile: # optional
|
|
|
|
# Sets the target stage to build
|
|
|
|
#target: # optional
|
|
|
|
# Always attempt to pull a newer version of the image
|
|
|
|
always_pull: true # optional
|
|
|
|
# Comma-delimited list of build-time variables
|
|
|
|
#build_args: # optional
|
|
|
|
# Comma-delimited list of images to consider as cache sources
|
|
|
|
#cache_froms: # optional
|
|
|
|
# Comma-delimited list of labels to add to the built image
|
|
|
|
#labels: # optional
|
|
|
|
# Adds labels with git repository information to the built image
|
|
|
|
add_git_labels: true # optional
|
|
|
|
# Whether to push the image
|
|
|
|
#push: # optional, default is true
|