update workflow

This commit is contained in:
Matteias Collet 2020-06-29 03:25:20 +02:00
parent 4edec7c4b7
commit 2092a008f4
3 changed files with 9 additions and 7 deletions

View file

@ -1,4 +1,4 @@
name: Deploy
name: CI/CD
on:
push:
@ -10,6 +10,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Create a new build
run: docker build -t publisher:latest -f ./dockerfiles/Deploy.Dockerfile .
deploy:
@ -19,13 +21,13 @@ jobs:
steps:
- name: Deploy to gh-pages branch
env:
GITHUB_PAT: ${{ secrets.GITHUB_PAT }}
REPOSITORY_TOKEN: ${{ secrets.REPOSITORY_TOKEN }}
PUBLISHER_NAME: ${{ secrets.PUBLISHER_NAME }}
PUBLISHER_EMAIL: ${{ secrets.PUBLISHER_EMAIL }}
run: |
docker run \
--rm \
-e GITHUB_PAT="$env:GITHUB_PAT" \
-e REPOSITORY_TOKEN="$env:REPOSITORY_TOKEN" \
-e PUBLISHER_NAME="$env:PUBLISHER_NAME" \
-e PUBLISHER_EMAIL="$env:PUBLISHER_EMAIL" \
publisher:latest

View file

@ -1,4 +1,4 @@
ARG GITHUB_PAT
ARG REPOSITORY_TOKEN
FROM mcr.microsoft.com/powershell:latest AS prebuild
WORKDIR /src
@ -12,8 +12,8 @@ RUN yarn
RUN yarn build
FROM mcr.microsoft.com/powershell:latest AS final
ARG GITHUB_PAT
ENV GITHUB_PAT ${GITHUB_PAT}
ARG REPOSITORY_TOKEN
ENV REPOSITORY_TOKEN ${REPOSITORY_TOKEN}
WORKDIR /src
RUN apt-get update
RUN apt install -y git

View file

@ -21,7 +21,7 @@ git commit -m "auto-deployment";
try {
# Force push to gh-pages
Write-Host "Pushing to gh-pages branch";
git push -uqf $env:GITHUB_PAT HEAD:gh-pages 2>&1 | Out-Null;
git push -uqf $env:REPOSITORY_TOKEN HEAD:gh-pages 2>&1 | Out-Null;
}
catch {
Write-Error "Push failed";