0.0.106 #60
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dockerize | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
defaults: | |
run: | |
working-directory: ./ | |
env: | |
BASE_PATH: / | |
jobs: | |
dockerize: | |
name: dockerize | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Reconfigure git to use HTTP authentication | |
run: > | |
git config --global url."https://github.com/".insteadOf | |
ssh://[email protected]/ | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 18 | |
- name: Configure Node caching | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules-dockerize | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: install latest npm | |
run: npm i -g npm@latest | |
- name: ci | |
run: npm ci | |
- name: check envs | |
run: | | |
echo "NEXT_PUBLIC_GRAPHQL_URL: $NEXT_PUBLIC_GQL_PATH" | |
- name: build next | |
run: npm run build | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: deepf/perception | |
- name: build docker image and push | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |