Skip to content

Commit

Permalink
remove redundant steps
Browse files Browse the repository at this point in the history
  • Loading branch information
loftwah committed Sep 1, 2024
1 parent bf0c727 commit 0dcb3af
Showing 1 changed file with 7 additions and 28 deletions.
35 changes: 7 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand Down Expand Up @@ -52,31 +53,9 @@ jobs:
RAILS_ENV: test

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_PAT }}

- name: Prepare Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/loftwah/linkarooie
tags: |
type=ref,event=branch
type=sha,format=long
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
# Build Docker image locally for testing
- name: Build Docker image
run: |
docker build -t myapp:ci-test .

0 comments on commit 0dcb3af

Please sign in to comment.