Skip to content

Commit

Permalink
customize (#1)
Browse files Browse the repository at this point in the history
Customize imported template for the real code
  • Loading branch information
fedordikarev authored Sep 25, 2024
1 parent 6d587e0 commit 0efc00b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 104 deletions.
67 changes: 15 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,65 +11,28 @@ on:
permissions:
contents: read

env:
IMAGE_NAME: gh-workflow-stats-action

jobs:
test-docker:
name: Docker Tests
docker:
runs-on: ubuntu-latest

# Run a local registry to push to
services:
registry:
image: registry:2
ports:
- 5001:5000

env:
TEST_TAG: localhost:5001/actions/hello-world-docer-action:latest

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
install: true
driver-opts: network=host
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build the Container
id: build
- name: Build and publish
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64, linux/arm64
push: true
tags: ${{ env.TEST_TAG }}

- name: Run the Container
id: run
env:
INPUT_WHO_TO_GREET: Mona Lisa Octocat
run: |
docker run \
--env INPUT_WHO_TO_GREET="${{ env.INPUT_WHO_TO_GREET }}" \
--rm ${{ env.TEST_TAG }}
test-action:
name: GitHub Actions Test
runs-on: ubuntu-latest

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

- name: Test Local Action
id: test-action
uses: ./
with:
who-to-greet: Mona Lisa Octocat

- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.time }}"
tags: ${{ vars.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
34 changes: 0 additions & 34 deletions .github/workflows/linter.yml

This file was deleted.

3 changes: 0 additions & 3 deletions CODEOWNERS

This file was deleted.

4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright GitHub
Copyright (c) 2024 Fedor Dikarev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
23 changes: 10 additions & 13 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
name: Hello, World!
description: Greet someone and record the time
author: GitHub Actions
name: Github Workflow Stats
description: Export Github Workflow stats into Postgres
author: Fedor Dikarev
branding:
icon: activity
color: yellow

# Define your inputs here.
inputs:
who-to-greet:
description: Who to greet
db_uri:
description: Postgres DB URI
required: true
default: World

# Define your outputs here.
outputs:
time:
description: The time we greeted you

runs:
using: docker
image: Dockerfile
image: "docker://yatheo/gh-workflow-stats-action:latest"
env:
INPUT_WHO_TO_GREET: ${{ inputs.who-to-greet }}
DB_URI: ${{ inputs.db_uri }}

0 comments on commit 0efc00b

Please sign in to comment.