36 lines
1.0 KiB
YAML
36 lines
1.0 KiB
YAML
name: "Nix"
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
jobs:
|
|
docker-build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- uses: cachix/install-nix-action@v6
|
|
- uses: cachix/cachix-action@v3
|
|
with:
|
|
name: xe
|
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
|
- run: |
|
|
nix-build docker.nix
|
|
docker load -i result
|
|
docker tag xena/christinewebsite:latest xena/christinewebsite:$GITHUB_SHA
|
|
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
|
|
docker push xena/christinewebsite
|
|
env:
|
|
DOCKER_USERNAME: "xena"
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
needs: docker-build
|
|
if: github.ref == 'refs/heads/master'
|
|
steps:
|
|
- uses: cachix/install-nix-action@v6
|
|
- name: deploy
|
|
run: ./scripts/release.sh
|
|
env:
|
|
DIGITALOCEAN_ACCESS_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
|