Skip to content

Commit

Permalink
Build image using GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
HenningCash committed Aug 24, 2021
1 parent 75bf6a3 commit fe4c74c
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build Docker Image

on: [push, pull_request, release]

jobs:
main:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v2
with:
path: |
~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Build Docker image
run: |
docker build -t cfreak/homepage-docs:latest .
- name: Before Deploy
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
run: |
docker logout
docker login -u "${{ secrets.DOCKER_USERNAME }}" -p "${{ secrets.DOCKER_PASSWORD }}"
- name: Deploy master branch as latest
if: github.ref == 'refs/heads/master'
run: |
docker push cfreak/homepage-docs:latest

0 comments on commit fe4c74c

Please sign in to comment.