Skip to content

Commit

Permalink
Merge pull request #806 from NetrunnerDB/one-workflow
Browse files Browse the repository at this point in the history
go back to one github workflow
  • Loading branch information
plural authored Feb 8, 2024
2 parents a53b78d + 53ecbf9 commit 3de6382
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 73 deletions.
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.

0 comments on commit 3de6382

Please sign in to comment.