Create README.md #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: My Test Action | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
packages: write | |
env: | |
ACTION_IMAGE_TAG: ghcr.io/atarrio/test-action/my-action | |
jobs: | |
build-and-push-action-image: | |
name: Build Action Image | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker Meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ env.ACTION_IMAGE_TAG }} | |
- name: Setup Docker BuildX | |
uses: docker/setup-buildx-action@v3 | |
with: | |
install: true | |
driver-opts: network=host | |
platforms: linux/amd64 | |
- name: Build and push action image | |
uses: docker/build-push-action@v6 | |
with: | |
context: .github/images | |
tags: ${{ env.ACTION_IMAGE_TAG }} | |
labels: ${{ steps.meta.outputs.labels }} | |
platforms: linux/amd64 | |
load: true | |
- name: Github container registry login | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push Images | |
run: | | |
docker push ${{ env.ACTION_IMAGE_TAG }} | |
test-action: | |
needs: build-and-push-action-image | |
name: Github Actions Test | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Github container registry login | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Test Action | |
id: test-action | |
uses: docker://ghcr.io/atarrio/test-action/my-action:latest | |
with: | |
my_input: "THIS IS SOME SILLY MESSAGE" | |
- name: Print Output | |
id: output | |
run: | | |
echo "OUTPUT: ${{ steps.test-action.outputs.my_output }}" | |