Skip to content
Closed
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
61 changes: 61 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# When a PR is merged, or when run manually, this workflow will create a
# release and publish the container image to the GitHub Container Registry. Both
# will be labeled with the version specified in the manifest file.
name: Continuous Delivery

on:
pull_request:
types:
- closed
branches:
- main
workflow_dispatch:

env:
CONTAINER_REGISTRY: ghcr.io
CONTAINER_REGISTRY_USERNAME: ${{ github.actor }}
CONTAINER_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
MANIFEST_PATH: action.yml

permissions:
contents: write
packages: write

jobs:
build:
name: Build and Publish
runs-on: ubuntu-latest

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

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

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.CONTAINER_REGISTRY }}
username: ${{ env.CONTAINER_REGISTRY_USERNAME }}
password: ${{ env.CONTAINER_REGISTRY_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.CONTAINER_REGISTRY }}/${{ github.repository }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Create Release
id: release
uses: issue-ops/releaser@v2
with:
tag: v${{ steps.meta.outputs.version }}
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Find LaunchDarkly feature flags in diff
uses: ./ # Uses an action in the root directory
uses: ghcr.io/launchdarkly/find-code-references-in-pull-request:latest # P4078
id: find-flags
with:
project-key: demo-dan-042021-2
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow checks the version of the container image that is being built
# in the current pull request. If the version has already been published, the
# workflow fails to prevent PRs from being merged until the version has been
# incremented in the manifest file.
name: Version Check

on:
pull_request:
branches:
- main

env:
MANIFEST_PATH: action.yml

permissions:
checks: write
contents: read
pull-requests: write

jobs:
check-version:
name: Version Check
runs-on: ubuntu-latest

if: ${{ github.actor != 'dependabot[bot]' }}

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-tags: true

- name: Check Version
id: check-version
uses: issue-ops/semver@v2
with:
check-only: true
manifest-path: ${{ env.MANIFEST_PATH }}
18 changes: 0 additions & 18 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: 'LaunchDarkly Code References in Pull Request'
description: 'Find references to feature flags in your pull request'
runs:
using: 'docker'
image: 'Dockerfile'
image: 'ghcr.io/launchdarkly/find-code-references-in-pull-request:latest'
env:
LD_PROJ_KEY: ${{ inputs.project-key }}
LD_ACCESS_TOKEN: ${{ inputs.access-token }}
Expand Down