Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go back to one github workflow #806

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ on:
pull_request:
branches:
- main
push:
branches:
- main

env:
# We do not need Husky hooks installed for this workflow.
HUSKY: 0
IMAGENAME: registry.digitalocean.com/nsgcr/netrunner-cards-json

jobs:
format_and_lint_and_test:
Expand All @@ -31,3 +35,37 @@ jobs:

- name: Test
run: npm run test

build_and_push:
name: Build docker image
needs: [format_and_lint_and_test]
runs-on: ubuntu-latest
steps:

- name: Checkout the repo
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build image
run: docker build -t $IMAGENAME:latest .

- name: Install doctl
if: github.ref == 'refs/heads/main'
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}

- name: Log in to DO Container Registry
if: github.ref == 'refs/heads/main'
run: doctl registry login --expiry-seconds 600

- name: Tag image with run id
if: github.ref == 'refs/heads/main'
run:
docker tag $IMAGENAME:latest $IMAGENAME:${{ github.run_id }}

- name: Push image to DO Container Registry
if: github.ref == 'refs/heads/main'
run: docker push $IMAGENAME:${{ github.run_id }} && docker push $IMAGENAME:latest
73 changes: 0 additions & 73 deletions .github/workflows/docker-cicd.yml

This file was deleted.

Loading