33 lines
767 B
YAML
33 lines
767 B
YAML
|
name: "CI for builds"
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
branches: [ master ]
|
||
|
|
||
|
env:
|
||
|
DOCKER_IMAGE: m1k1o/blog:latest
|
||
|
|
||
|
jobs:
|
||
|
build:
|
||
|
runs-on: ubuntu-latest
|
||
|
#
|
||
|
# do not run on forks
|
||
|
#
|
||
|
if: github.repository_owner == 'm1k1o'
|
||
|
steps:
|
||
|
- name: Check Out Repo
|
||
|
uses: actions/checkout@v2
|
||
|
|
||
|
- name: Login to Docker Hub
|
||
|
run: |
|
||
|
docker login --username "${DOCKER_USERNAME}" --password-stdin "${DOCKER_REGISTRY}" <<< "${DOCKER_TOKEN}"
|
||
|
env:
|
||
|
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
|
||
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||
|
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
|
||
|
|
||
|
- name: Build blog
|
||
|
run: |
|
||
|
docker build -t ${DOCKER_IMAGE} .
|
||
|
docker push ${DOCKER_IMAGE}
|