Skip to content

CI- build docker and push it on docker hub V0 #1

CI- build docker and push it on docker hub V0

CI- build docker and push it on docker hub V0 #1

Workflow file for this run

name: Build and Push Docker Image - CI
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Create env file
run: |
touch .env
echo ACCESS_TOKEN_SECRET = access_secret >> .env
echo REFRESH_TOKEN_SECRET = refresh_secret >> .env
cat .env
- name: Build the project
run: npm run prod:build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: .
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/your-image-name:latest