refactor(CopBot): copbot class to use instance properties and remove … #125
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: CI/CD Pipeline | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm install | |
- name: Build Docker image | |
run: docker build -t cop . | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Tag Docker image | |
run: | | |
docker tag cop ${{ secrets.DOCKER_USERNAME }}/cop:latest | |
docker tag cop ${{ secrets.DOCKER_USERNAME }}/cop:${{ github.sha }} | |
- name: Push Docker image | |
run: | | |
docker push ${{ secrets.DOCKER_USERNAME }}/cop:latest | |
docker push ${{ secrets.DOCKER_USERNAME }}/cop:${{ github.sha }} | |
- name: Clean up | |
run: docker system prune -f |