Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: enhance GitHub Actions for IPv6 and flexibility #303

Merged
merged 2 commits into from
Mar 16, 2024
Merged

ci: enhance GitHub Actions for IPv6 and flexibility #303

merged 2 commits into from
Mar 16, 2024

Conversation

appleboy
Copy link
Owner

@appleboy appleboy commented Mar 16, 2024

  • Add a new CI job for testing IPv6 in GitHub Actions workflow
  • Update the Docker image version from 1.7.3 to 1.7.4
  • Add a new protocol input parameter to the GitHub action with a default value of tcp
  • Change the GitHub action to use a composite run steps action instead of a Docker container
  • Update the entrypoint.sh script to use bash instead of sh, set stricter error handling, and add a function to detect client platform and architecture
  • Modify the entrypoint.sh script to download a specific version of drone-ssh based on the detected client info and execute it

fixed #146
reference: actions/runner-images#668

- Add a new CI job for testing IPv6 in GitHub Actions workflow
- Update the Docker image version from `1.7.3` to `1.7.4`
- Add a new `protocol` input parameter to the GitHub action with a default value of `tcp`
- Change the GitHub action to use a composite run steps action instead of a Docker container
- Update the `entrypoint.sh` script to use `bash` instead of `sh`, set stricter error handling, and add a function to detect client platform and architecture
- Modify the `entrypoint.sh` script to download a specific version of `drone-ssh` based on the detected client info and execute it

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Remove IPv6 ping command from CI workflow
- Uncomment Docker run configuration in action.yml

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@appleboy appleboy merged commit c781418 into master Mar 16, 2024
6 checks passed
@appleboy appleboy deleted the ipv6 branch March 16, 2024 07:45
@muckelba
Copy link

Hey, this PR broke my pipeline:
image

I have zero clue why changing the shebang from #!/bin/sh to #!/usr/bin/env bash should cause this error.
I'm using ubuntu-latest for that job.

@appleboy
Copy link
Owner Author

@muckelba I will take it. Thanks for your report.

@appleboy
Copy link
Owner Author

@muckelba I try the ubuntu-latest os. It is working. Can you show all the configs?

@muckelba
Copy link

name: Create, publish and deploy a Docker image

on:
  push:
    branches:
      - main
      - develop

env:
  REGISTRY: ghcr.io
  IMAGE_NAME: ${{ github.repository }}

jobs:
  build-and-push-image:
    runs-on: ubuntu-latest

    steps:
      - name: Check out code
        uses: actions/checkout@v3

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

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

      - name: Build Docker image
        uses: docker/build-push-action@v3
        with:
          context: .
          push: true
          tags: ghcr.io/${{ env.IMAGE_NAME }}:${{ github.ref_name }}

  deploy:
    runs-on: ubuntu-latest
    needs: build-and-push-image

    steps:
      - name: SSH Deploy
        uses: appleboy/ssh-action@master
        with:
          host: ${{ secrets.HOST }}
          username: ${{ secrets.USERNAME }}
          key: ${{ secrets.SSHKEY }}
          script: |
            cd ${{ secrets.PATH }}_${{ github.ref_name }}
            echo ${{ secrets.GITHUB_TOKEN }} | docker login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin
            docker compose pull && docker compose up -d

this is my whole config

@appleboy
Copy link
Owner Author

@muckelba move to #306 for further discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error while ssh into ipv6 server.
2 participants