Commit
This commit is contained in:
38
.github/workflows/docker-image.yml
vendored
38
.github/workflows/docker-image.yml
vendored
@@ -12,37 +12,41 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Setup Node.js for Building Frontend
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '18'
|
node-version: '18'
|
||||||
|
|
||||||
- name: Install and Build Frontend
|
- name: Install Dependencies and Build Frontend
|
||||||
run: |
|
run: |
|
||||||
cd frontend
|
cd frontend
|
||||||
npm install
|
npm install
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
- name: Cache Docker layers
|
- name: Set up QEMU
|
||||||
uses: actions/cache@v2
|
uses: docker/setup-qemu-action@v1
|
||||||
with:
|
|
||||||
path: /tmp/.buildx-cache
|
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-buildx-
|
|
||||||
|
|
||||||
- name: Login to Docker Registry (GHCR)
|
- name: Login to Docker Registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Lowercase repository owner
|
||||||
run: docker build -f Dockerfile -t ghcr.io/${{ github.repository_owner }}/ssh-project:${{ github.run_id }} .
|
id: lowercase_repo_owner
|
||||||
|
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Push Docker image to GHCR
|
- name: Build and Push Docker image
|
||||||
run: docker push ghcr.io/${{ github.repository_owner }}/ssh-project:${{ github.run_id }}
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ghcr.io/${{ env.REPO_OWNER }}/ssh-project:${{ github.run_id }}
|
||||||
|
|
||||||
|
- name: Post-build clean-up
|
||||||
|
run: docker system prune -af
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":1,"resource":"vscode-remote://coder.karmaashomepage.online/home/bugattiguy527/.github/workflows/docker-image.yml","entries":[{"id":"9X2e.yml","timestamp":1732667889336},{"id":"3EZP.yml","timestamp":1732667936044},{"id":"jUoS.yml","source":"undoRedo.source","timestamp":1732667990352},{"id":"YqrT.yml","timestamp":1732669649485}]}
|
{"version":1,"resource":"vscode-remote://coder.karmaashomepage.online/home/bugattiguy527/.github/workflows/docker-image.yml","entries":[{"id":"9X2e.yml","timestamp":1732667889336},{"id":"3EZP.yml","timestamp":1732667936044},{"id":"jUoS.yml","source":"undoRedo.source","timestamp":1732667990352},{"id":"YqrT.yml","timestamp":1732669649485},{"id":"gDh9.yml","timestamp":1732670036109}]}
|
||||||
52
.local/share/code-server/User/History/-75aa7516/gDh9.yml
Normal file
52
.local/share/code-server/User/History/-75aa7516/gDh9.yml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup Node.js for Building Frontend
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '18'
|
||||||
|
|
||||||
|
- name: Install Dependencies and Build Frontend
|
||||||
|
run: |
|
||||||
|
cd frontend
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
- name: Setup Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
|
- name: Login to Docker Registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Lowercase repository owner
|
||||||
|
id: lowercase_repo_owner
|
||||||
|
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Build and Push Docker image
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ghcr.io/${{ env.REPO_OWNER }}/ssh-project:${{ github.run_id }}
|
||||||
|
|
||||||
|
- name: Post-build clean-up
|
||||||
|
run: docker system prune -af
|
||||||
Reference in New Issue
Block a user