Skip to content

Commit

Permalink
Publish Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
QubitPi committed Jan 8, 2024
1 parent 484ff9f commit 9e2d795
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 19 deletions.
66 changes: 48 additions & 18 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,54 @@
# Copyright Jiaqi Liu. All rights reserved.
---
name: Screwdriver API CI/CD
name: Screwdriver CI/CD

"on":
pull_request:
push:
branches:
- master
pull_request:
push:
branches:
- master

USER: QubitPi
EMAIL: jack20220723@gmail.com

jobs:
tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set node version to 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Run unit tests
run: npm test
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install
- run: npm test

docker-image:
name: Build Test & Release Development Docker Image
needs: tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Test image build
uses: docker/build-push-action@v3
with:
context: .
push: false
- name: Login to DockerHub
# if: github.ref == 'refs/heads/master'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push image to DockerHub
# if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/screwdriver:latest
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"screwdriver-data-schema": "^22.9.12",
"screwdriver-datastore-sequelize": "^8.0.0",
"screwdriver-executor-base": "^9.0.1",
"screwdriver-executor-docker": "^6.0.0",
"screwdriver-cd-executor-docker": "^6.0.1",
"screwdriver-executor-k8s": "^15.0.1",
"screwdriver-executor-k8s-vm": "^4.3.3",
"screwdriver-executor-queue": "^4.0.0",
Expand Down

0 comments on commit 9e2d795

Please sign in to comment.