name: release on: release: # Docs: types: [published] jobs: demo: name: Update demonstration, hosted on github pages runs-on: ubuntu-20.04 steps: - name: Check out code uses: actions/checkout@v2 - name: Setup NodeJS uses: actions/setup-node@v1 # Action page: with: node-version: 15 - uses: actions/cache@v2 with: path: '**/node_modules' key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - name: Install dependencies working-directory: generator run: yarn install - name: Generate pages run: ./generator/generator.js -i -c ./config.json -o ./out - name: Upload artifact uses: actions/upload-artifact@v2 with: name: content path: out/ - name: Switch to github pages branch uses: actions/checkout@v2 with: ref: gh-pages - name: Download artifact uses: actions/download-artifact@v2 with: name: content - name: Setup git run: | git config --global user.name "$GITHUB_ACTOR" git config --global user.email 'actions@github.com' git remote add github "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git" - name: Stage changes run: git add . - name: Commit changes run: git commit --allow-empty -m "Deploying ${GITHUB_SHA} to Github Pages" - name: Push changes run: git push github --force docker-image: name: Build docker image runs-on: ubuntu-20.04 steps: - name: Check out code uses: actions/checkout@v2 - name: Set up QEMU uses: docker/setup-qemu-action@v1 # Action page: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 # Action page: - name: Docker login in default registry run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_LOGIN }}" --password-stdin - name: Docker login in ghcr.io # Auth docs: run: echo "${{ secrets.GHCR_PASSWORD }}" | docker login ghcr.io -u tarampampam --password-stdin - name: Generate builder values id: values run: echo "::set-output name=version::${GITHUB_REF##*/[vV]}" # `/refs/tags/v1.2.3` -> `1.2.3` - name: Build image run: | docker buildx build \ --platform "linux/amd64,linux/386,linux/arm64/v8,linux/arm/v6,linux/arm/v7" \ --tag "tarampampam/error-pages:${{ steps.values.outputs.version }}" \ --tag "tarampampam/error-pages:latest" \ --tag "ghcr.io/tarampampam/error-pages:${{ steps.values.outputs.version }}" \ --tag "ghcr.io/tarampampam/error-pages:latest" \ --file ./Dockerfile \ --push \ .