Skip to content

New pages

New pages #135

Workflow file for this run

name: Dockerize
on:
pull_request:
branches:
- main
jobs:
dockerize:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Extract number of pull request
id: pull_request
run: |
echo ::set-output name=number::$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
- name: Prints number of pull request
run: echo Pull request branch is '${{ steps.pull_request.outputs.number }}'
- name: Send Discord Notification
uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_GITHUB_CHANNEL_WEBHOOK }}
title: "Dockerize"
description: "PR: ${{ steps.pull_request.outputs.number }}"
color: 0xffed2b
username: GitHub Actions
- name: Git Identity
run: |
git config --global user.name 'geovbot'
git config --global user.email '[email protected]'
git remote set-url origin https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v2
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Tag this commit with pr
id: npm_version
run: |
npm version prerelease --preid pr-${{steps.pull_request.outputs.number}} --no-git-tag-version
echo ::set-output name=tag::$(cat ./package.json | jq -r '.version')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Echo tag created by npm
run: echo your tag is '${{steps.npm_version.outputs.tag}}'
- name: Update Lock file
run: 'npm i --package-lock-only'
- uses: EndBug/add-and-commit@v5
with:
message: 'chore(): update prerelease version'
tag: v${{steps.npm_version.outputs.tag}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Build & Push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ghcr.io/geovistory/website:${{steps.npm_version.outputs.tag}}
- name: Send Discord Notification
uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_GITHUB_CHANNEL_WEBHOOK }}
title: "Dockerize > Done"
description: "Image Tag: ${{steps.npm_version.outputs.tag}}"
color: 0x0000ff
username: GitHub Actions